diff --git a/cli/options.go b/cli/options.go index c1d54ee6..50b6f07d 100644 --- a/cli/options.go +++ b/cli/options.go @@ -461,8 +461,9 @@ func withNamePrecedenceLoad(absWorkingDir string, options *ProjectOptions) func( func withConvertWindowsPaths(options *ProjectOptions) func(*loader.Options) { return func(o *loader.Options) { - o.ConvertWindowsPaths = utils.StringToBool(options.Environment["COMPOSE_CONVERT_WINDOWS_PATHS"]) - o.ResolvePaths = true + if o.ResolvePaths { + o.ConvertWindowsPaths = utils.StringToBool(options.Environment["COMPOSE_CONVERT_WINDOWS_PATHS"]) + } } } diff --git a/cli/options_windows_test.go b/cli/options_windows_test.go index 9effc849..fc58d2a2 100644 --- a/cli/options_windows_test.go +++ b/cli/options_windows_test.go @@ -28,7 +28,8 @@ func TestConvertWithEnvVar(t *testing.T) { defer os.Unsetenv("COMPOSE_CONVERT_WINDOWS_PATHS") opts, _ := NewProjectOptions([]string{"testdata/simple/compose-with-paths.yaml"}, WithOsEnv, - WithWorkingDirectory("C:\\project-dir\\")) + WithWorkingDirectory("C:\\project-dir\\"), + WithResolvedPaths(true)) p, err := ProjectFromOptions(opts)