Skip to content

Commit 188ec79

Browse files
committed
fix: nil pointer
1 parent 2be7585 commit 188ec79

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

pkg/commands/install/install.go

+11-4
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func Execute(c *cli.Context) error {
8484

8585
if c.String("version") == "latest" && !c.Bool("force") {
8686
latestInstalled := inv.GetLatestVersion(fmt.Sprintf("%s/%s", src.GetSource(), src.GetApp()))
87-
if latestInstalled.Version == src.GetVersion() {
87+
if latestInstalled != nil && latestInstalled.Version == src.GetVersion() {
8888
log.Warnf("already installed")
8989
log.Infof("reinstall with --force (%s)", time.Since(start))
9090
return nil
@@ -207,15 +207,22 @@ func Flags() []cli.Flag {
207207
Aliases: []string{"pre"},
208208
},
209209
&cli.BoolFlag{
210-
Name: "no-checksum-verify",
211-
Usage: "disable checksum verification",
210+
Name: "no-checksum-verify",
211+
Usage: "disable checksum verification",
212+
EnvVars: []string{"DISTILLERY_NO_CHECKSUM_VERIFY"},
213+
},
214+
&cli.BoolFlag{
215+
Name: "no-signature-verify",
216+
Usage: "disable signature verification",
217+
EnvVars: []string{"DISTILLERY_NO_SIGNATURE_VERIFY"},
212218
},
213219
&cli.BoolFlag{
214220
Name: "no-score-check",
215221
Usage: "disable scoring check",
216222
},
217223
&cli.BoolFlag{
218-
Name: "force",
224+
Name: "force",
225+
Usage: "force the installation of the binary even if it is already installed",
219226
},
220227
}
221228
}

0 commit comments

Comments
 (0)