feat(packages/commit): make reroll prompt not require enter

This commit is contained in:
Mohammad Rafiq 2025-06-13 06:21:22 +08:00
parent 66bc9f679d
commit 87c196e499
No known key found for this signature in database

View file

@ -27,10 +27,11 @@ pkgs.writeShellScriptBin "commit" # bash
RESPONSE=$(aichat "$PROMPT\nGuidelines: $GUIDELINES\nContext from git log:\n$CONTEXT\nDiff from git diff HEAD:\n$DIFF") RESPONSE=$(aichat "$PROMPT\nGuidelines: $GUIDELINES\nContext from git log:\n$CONTEXT\nDiff from git diff HEAD:\n$DIFF")
while true; do while true; do
echo "Generated Commit Message:"
echo "$RESPONSE" echo "$RESPONSE"
echo "Options: [y]es, [r]eroll, [e]dit, [q]uit?" echo
read -r -p "Choose an action: " choice echo "Choose an action:"
read -p "Options: [y]es, [r]eroll, [e]dit, [q]uit?" -n 1 -r choice
echo
case "$choice" in case "$choice" in
y | yes) y | yes)