Exemple #1
0
func appDelAction(c *cli.Context) {
	appname := c.String("d")
	super, err := context.CheckSuperPerm(context.Config.User)
	if err != nil {
		fmt.Println(err)
		return
	}
	if !super {
		fmt.Println("You have no permission to this operation")
		return
	}
	if appname == "" {
		appname = context.GetAppName()
	}

	fmt.Printf("Type %s to continue: ", "yes")
	var cmd string
	fmt.Scanf("%s\n", &cmd)
	if cmd != "yes" {
		return
	}
	_, version, err := context.GetApp(appname)
	if err != nil {
		fmt.Println(err)
		return
	}
	err = context.DelApp(appname, version)
	if err != nil {
		fmt.Println(err)
		return
	} else {
		fmt.Printf("Delete %s success\n", appname)
	}
}
Exemple #2
0
func appDelAction(c *cli.Context) {
	appname := context.GetAppName()

	fmt.Printf("Type %s to continue: ", "yes")
	var cmd string
	fmt.Scanf("%s\n", &cmd)
	if cmd != "yes" {
		return
	}
	_, version, err := context.GetApp(appname)
	if err != nil {
		fmt.Println(err)
		return
	}
	err = context.DelApp(appname, version)
	if err != nil {
		fmt.Println(err)
		return
	} else {
		fmt.Printf("Delete %s success\n", appname)
	}
}