Skip to content

Commit e50ae1a

Browse files
committed
fix: set process working dir based on relative path of -f file too
Why === * extends now sets the working dir of the processes in it based on the relative path of the process-compose file. * The documentation says that -f should be equvalent to using extends * However, -f does not set the workign dir of the process to match the process-compose file's path * To make the documentation consistent again, we should also set the working dir for the -f filename case. What changed === * Move the working dir copy from loadExtendProject to loadProjectFromFile Test plan === * -f and extends both set the expected working dir of the processes in my local tests
1 parent 9d9e730 commit e50ae1a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/loader/loader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ func loadExtendProject(p *types.Project, opts *LoaderOptions, file string, index
9393
log.Error().Err(err).Msgf("Failed to load the extend project %s", p.ExtendsProject)
9494
return fmt.Errorf("failed to load extend project %s: %w", p.ExtendsProject, err)
9595
}
96-
copyWorkingDirToProcesses(project, filepath.Dir(p.ExtendsProject))
9796
opts.projects = slices.Insert(opts.projects, index, project)
9897
err = loadExtendProject(project, opts, p.ExtendsProject, index)
9998
if err != nil {
@@ -161,6 +160,7 @@ func loadProjectFromFile(inputFile string, opts *LoaderOptions) (*types.Project,
161160
}
162161
}
163162

163+
copyWorkingDirToProcesses(project, filepath.Dir(inputFile))
164164
log.Info().Msgf("Loaded project from %s", inputFile)
165165
return project, nil
166166
}

0 commit comments

Comments
 (0)