示例#1
0
文件: tags.go 项目: laurrentt/deis
// TagsUnset removes an app's tags.
func TagsUnset(appID string, tags []string) error {
	c, appID, err := load(appID)

	if err != nil {
		return err
	}

	fmt.Print("Applying tags... ")

	quit := progress()

	configObj := api.Config{}

	tagsMap := make(map[string]interface{})

	for _, tag := range tags {
		tagsMap[tag] = nil
	}

	configObj.Tags = tagsMap

	_, err = config.Set(c, appID, configObj)

	quit <- true
	<-quit

	if err != nil {
		return err
	}

	fmt.Print("done\n\n")

	return TagsList(appID)
}
示例#2
0
文件: tags.go 项目: laurrentt/deis
// TagsSet sets an app's tags.
func TagsSet(appID string, tags []string) error {
	c, appID, err := load(appID)

	if err != nil {
		return err
	}

	tagsMap := parseTags(tags)

	fmt.Print("Applying tags... ")

	quit := progress()
	configObj := api.Config{}
	configObj.Tags = tagsMap

	_, err = config.Set(c, appID, configObj)

	quit <- true
	<-quit

	if err != nil {
		return err
	}

	fmt.Print("done\n\n")

	return TagsList(appID)
}