My omnium-gatherom of scripts and source code.
1#!/bin/sh
2set -e
3
4TYPE=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert" "ci" "build")
5
6SCOPE=$(gum input --placeholder "scope")
7
8# Since the scope is optional, wrap it in parentheses if it has a value.
9test -n "$SCOPE" && SCOPE="($SCOPE)"
10
11gum confirm "Does this introduce a breaking change?" && SCOPE="$SCOPE!"
12
13# Pre-populate the input with the type(scope): so that the user may change it
14SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this change")
15DESCRIPTION=$(gum write --placeholder "Details of this change (CTRL+D to finish)")
16FOOTER=$(gum write --placeholder "Footer: text (CTRL+D to finish)")
17
18# Commit these changes
19gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION"