浏览代码

check arg is given

Alex Suraci 7 年之前
父节点
当前提交
7381fb98bf
共有 1 个文件被更改,包括 6 次插入0 次删除
  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