Skip to content

Commit f38f3f7

Browse files
ndeloofglours
authored andcommitted
PWD
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
1 parent ea07ba8 commit f38f3f7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cmd/compose/compose.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,18 @@ func (o *ProjectOptions) remoteLoaders(dockerCli command.Cli) []loader.ResourceL
383383
}
384384

385385
func (o *ProjectOptions) toProjectOptions(po ...cli.ProjectOptionsFn) (*cli.ProjectOptions, error) {
386+
pwd, err := os.Getwd()
387+
if err != nil {
388+
return nil, err
389+
}
390+
386391
return cli.NewProjectOptions(o.ConfigPaths,
387392
append(po,
388393
cli.WithWorkingDirectory(o.ProjectDir),
389394
// First apply os.Environment, always win
390395
cli.WithOsEnv,
396+
// set PWD as this variable is not consistently supported on Windows
397+
cli.WithEnv([]string{"PWD=" + pwd}),
391398
// Load PWD/.env if present and no explicit --env-file has been set
392399
cli.WithEnvFiles(o.EnvFiles...),
393400
// read dot env file to populate project environment

0 commit comments

Comments
 (0)