Skip to content

Commit

Permalink
fix: --path flag in update
Browse files Browse the repository at this point in the history
Recent changes have resulted in the `wolfictl update --path` flag
breaking.

This flag allows for working with a repo where the melange yaml's are in
a subdir such as `./packages` of the repo.

> ℹ️            | 2024/01/31 00:40:50 wolfictl update: attempt 1: failed to update packages in git repository: failed to parse open docker-compose.yaml: no such file or directory
  • Loading branch information
joemiller committed Jan 31, 2024
1 parent 791af07 commit 980e0a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func (o *Options) updateGitPackage(ctx context.Context, repo *git.Repository, pa
root := worktree.Filesystem.Root()
log.Printf("working directory: %s", root)

configFile := filepath.Join(root, pc.Filename)
configFile := filepath.Join(pc.Dir, pc.Filename)
if configFile == "" {
return "", fmt.Errorf("no config filename found for package %s", packageName)
}
Expand Down Expand Up @@ -416,7 +416,7 @@ func (o *Options) updateGitPackage(ctx context.Context, repo *git.Repository, pa
}

// now make sure update config is configured
updated, err := config.ParseConfiguration(ctx, filepath.Join(root, pc.Filename))
updated, err := config.ParseConfiguration(ctx, filepath.Join(pc.Dir, pc.Filename))
if err != nil {
return "", fmt.Errorf("failed to parse %v", err)
}
Expand All @@ -435,7 +435,7 @@ func (o *Options) updateGitPackage(ctx context.Context, repo *git.Repository, pa

// Skip any processing for definitions with a single pipeline
if len(updated.Pipeline) > 1 {
if err := o.updateGoBumpDeps(updated, root, pc.Filename, mutations); err != nil {
if err := o.updateGoBumpDeps(updated, pc.Dir, pc.Filename, mutations); err != nil {
return fmt.Sprintf("error cleaning up go/bump deps: %v", err), nil
}
}
Expand Down

0 comments on commit 980e0a5

Please sign in to comment.