예제 #1
0
func upload(c *cli.Context) {
	initFlags(c, "upload")
	size := len(c.Args())
	if size != 2 {
		utils.Exit("Wrong number of arguments. Try 'art upload --help'.")
	}
	localPath := c.Args()[0]
	targetPath := c.Args()[1]
	commands.Upload(localPath, targetPath, flags)
}
예제 #2
0
func upload(c *cli.Context) {
	initFlags(c, "upload")
	size := len(c.Args())
	if size != 2 {
		utils.Exit(utils.ExitCodeError, "Wrong number of arguments. Try 'art upload --help'.")
	}
	localPath := c.Args()[0]
	targetPath := c.Args()[1]
	uploaded, failed := commands.Upload(localPath, targetPath, flags)
	if failed > 0 {
		if uploaded > 0 {
			utils.Exit(utils.ExitCodeWarning, "")
		}
		utils.Exit(utils.ExitCodeError, "")
	}
}