From 980e0a54677c5e4dd4b6c8d4b5c8ea40a32e1fd0 Mon Sep 17 00:00:00 2001 From: joe miller Date: Wed, 31 Jan 2024 00:53:37 +0000 Subject: [PATCH] fix: --path flag in update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- pkg/update/update.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/update/update.go b/pkg/update/update.go index 671f373f5..3c348d37a 100644 --- a/pkg/update/update.go +++ b/pkg/update/update.go @@ -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) } @@ -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) } @@ -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 } }