コード例 #1
0
ファイル: main.go プロジェクト: jkotrlik/salsaflow
func printWarning(commits []*git.Commit) error {
	console, err := prompt.OpenConsole(os.O_WRONLY)
	if err != nil {
		return err
	}
	defer console.Close()

	fmt.Fprintln(console)
	hooks.PrintUnassignedWarning(console, commits)
	fmt.Fprintln(console)

	return nil
}
コード例 #2
0
ファイル: main.go プロジェクト: salsaflow/salsaflow
func promptUserForConfirmation(commits []*git.Commit) (bool, error) {
	// Open the console.
	console, err := prompt.OpenConsole(os.O_WRONLY)
	if err != nil {
		return false, err
	}
	defer console.Close()

	// Print the list of commits missing the Story-Id tag.
	fmt.Fprintln(console)
	hooks.PrintUnassignedWarning(console, commits)
	fmt.Fprintln(console)

	// Prompt the user for confirmation.
	defer fmt.Fprintln(console)
	return prompt.Confirm("Are you sure you want to push these commits?", false)
}