Skip to content

Commit 980e0a5

Browse files
committed
fix: --path flag in update
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
1 parent 791af07 commit 980e0a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/update/update.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ func (o *Options) updateGitPackage(ctx context.Context, repo *git.Repository, pa
369369
root := worktree.Filesystem.Root()
370370
log.Printf("working directory: %s", root)
371371

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

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

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

0 commit comments

Comments
 (0)