예제 #1
0
// PromptUserForConfig is a part of loader.ConfigContainer interface.
func (local *LocalConfig) PromptUserForConfig() error {
	c := LocalConfig{spec: local.spec}

	// Prompt for the state labels.
	if err := prompt.Dialog(&c, "Insert the"); err != nil {
		return err
	}

	// Prompt for the story labels.
	storyLabels, err := promptForLabelList("Insert the story labels", DefaultStoryLabels, nil)
	fmt.Println()
	if err != nil {
		return err
	}
	c.StoryLabels = storyLabels

	// Prompt for the release skip check labels.
	skipCheckLabels, err := promptForLabelList(
		"Insert the skip release check labels", nil, ImplicitSkipCheckLabels)
	if err != nil {
		return err
	}
	c.SkipCheckLabels = skipCheckLabels

	// Success!
	*local = c
	return nil
}
예제 #2
0
// PromptUserForConfig is a part of loader.ConfigContainer
func (global *GlobalConfig) PromptUserForConfig() error {
	var c GlobalConfig
	if err := prompt.Dialog(&c, "Insert your"); err != nil {
		return err
	}

	*global = c
	return nil
}
예제 #3
0
// PromptUserForConfig is a part of loader.ConfigContainer interface.
func (local *LocalConfig) PromptUserForConfig() error {
	task := "Prompt the user for local Git-related configuration"

	var c LocalConfig
	if err := prompt.Dialog(&c, "Insert the"); err != nil {
		return errs.NewError(task, err)
	}

	*local = c
	return nil
}
예제 #4
0
func (local *LocalConfig) PromptUserForConfig() error {
	task := "Prompt the user for local versioning-related configuration"

	for {
		var c LocalConfig
		if err := prompt.Dialog(&c, "Insert the"); err != nil {
			return errs.NewError(task, err)
		}

		if _, err := c.parse(); err != nil {
			fmt.Println()
			color.Yellow("Invalid version suffix inserted, please try again!")
			fmt.Println()
			continue
		}

		*local = c
		return nil
	}
}