Skip to content

Commit

Permalink
Fix argument passing
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-lebot committed Feb 4, 2025
1 parent 67ecbaf commit 2ae6f38
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/fleet/internal/exec/installer_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ func (i *InstallerExec) Install(ctx context.Context, url string, args []string)

// ForceInstall installs a package, even if it's already installed.
func (i *InstallerExec) ForceInstall(ctx context.Context, url string, args []string) (err error) {
return i.Install(ctx, url, append(args, "--force"))
var cmdLineArgs = []string{url, "--force"}
if len(args) > 0 {
cmdLineArgs = append(cmdLineArgs, "--install_args", strings.Join(args, ","))
}
cmd := i.newInstallerCmd(ctx, "install", cmdLineArgs...)
defer func() { cmd.span.Finish(err) }()
return cmd.Run()
}

// Remove removes a package.
Expand Down

0 comments on commit 2ae6f38

Please sign in to comment.