#!/usr/bin/env bash

TYPE=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert")
SCOPE=$(gum input --placeholder "scope")

test -n "$SCOPE" && SCOPE="($SCOPE)"

SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "summary of this change")
DESCRIPTION=$(gum write --placeholder "details of this change (<C-d> to finish)")

gum confirm "commit changes?" && yadm commit -m "$SUMMARY" -m "$DESCRIPTION"