Explorar el Código

check arg is given

Alex Suraci hace 7 años
padre
commit
7381fb98bf
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  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