Parcourir la source

check arg is given

Alex Suraci il y a 7 ans
Parent
commit
7381fb98bf
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      cmd/in/main.go

+ 6 - 0
cmd/in/main.go

@@ -45,6 +45,12 @@ func main() {
 		return
 	}
 
+	if len(os.Args) < 2 {
+		logrus.Errorf("destination path not specified")
+		os.Exit(1)
+		return
+	}
+
 	dest := os.Args[1]
 
 	ref := req.Source.Repository + ":" + req.Source.Tag