Skip to content

Commit

Permalink
Merge pull request #830 from deitch/update-workdir
Browse files Browse the repository at this point in the history
fix --workdir
  • Loading branch information
deitch authored Jul 28, 2023
2 parents c68c72f + 88e4041 commit 764deec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions internal/cli/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ func buildImageComponents(ctx context.Context, wd string, archs []types.Architec
if err != nil {
return fmt.Errorf("failed to get installed packages for %q: %w", arch, err)
}
// this should be unnecessary, as the arch list already is unique,
// but the race detector complains, so we can use it anyways
mtx.Lock()
pkgs[arch] = installed
mtx.Unlock()
// Compute the "build date epoch" from the packages that were
// installed. The "build date epoch" is the MAX of the builddate
// embedded in the installed APKs. If SOURCE_DATE_EPOCH is
Expand Down
6 changes: 3 additions & 3 deletions internal/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func New() *cobra.Command {
SilenceUsage: true,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
http.DefaultTransport = userAgentTransport{http.DefaultTransport}
if cwd != "" {
if err := os.Chdir(cwd); err != nil {
fmt.Printf("failed to change dir to %s: %v\n", cwd, err)
if workDir != "" {
if err := os.Chdir(workDir); err != nil {
fmt.Printf("failed to change dir to %s: %v\n", workDir, err)
}
}
},
Expand Down

0 comments on commit 764deec

Please sign in to comment.