Skip to content

Commit

Permalink
fix(pkg): Correctly set appropriate arguments (#1041)
Browse files Browse the repository at this point in the history
Reviewed-by: Razvan Deaconescu <[email protected]>
Approved-by: Razvan Deaconescu <[email protected]>
  • Loading branch information
razvand authored Nov 28, 2023
2 parents 5678ce5 + 2bc5c5f commit c6bbfbf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/cli/kraft/pkg/packager_kraftfile_unikraft.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ func (p *packagerKraftfileUnikraft) Pack(ctx context.Context, opts *PkgOptions,
opts.Args = targ.Command()
}

// If no arguments have been specified, use the ones which are default and
// that have been included in the package.
if len(opts.Args) == 0 {
if len(opts.Project.Command()) > 0 {
opts.Args = opts.Project.Command()
} else if len(targ.Command()) > 0 {
opts.Args = targ.Command()
}
}

cmdShellArgs, err := shellwords.Parse(strings.Join(opts.Args, " "))
if err != nil {
return nil, err
Expand Down

0 comments on commit c6bbfbf

Please sign in to comment.