Browse Source

check arg is given

Alex Suraci 7 năm trước cách đây
mục cha
commit
7381fb98bf
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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