Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nil pointer #65

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions pkg/commands/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func Execute(c *cli.Context) error {

if c.String("version") == "latest" && !c.Bool("force") {
latestInstalled := inv.GetLatestVersion(fmt.Sprintf("%s/%s", src.GetSource(), src.GetApp()))
if latestInstalled.Version == src.GetVersion() {
if latestInstalled != nil && latestInstalled.Version == src.GetVersion() {
log.Warnf("already installed")
log.Infof("reinstall with --force (%s)", time.Since(start))
return nil
Expand Down Expand Up @@ -207,15 +207,22 @@ func Flags() []cli.Flag {
Aliases: []string{"pre"},
},
&cli.BoolFlag{
Name: "no-checksum-verify",
Usage: "disable checksum verification",
Name: "no-checksum-verify",
Usage: "disable checksum verification",
EnvVars: []string{"DISTILLERY_NO_CHECKSUM_VERIFY"},
},
&cli.BoolFlag{
Name: "no-signature-verify",
Usage: "disable signature verification",
EnvVars: []string{"DISTILLERY_NO_SIGNATURE_VERIFY"},
},
&cli.BoolFlag{
Name: "no-score-check",
Usage: "disable scoring check",
},
&cli.BoolFlag{
Name: "force",
Name: "force",
Usage: "force the installation of the binary even if it is already installed",
},
}
}
Expand Down