mirror of
https://github.com/charmbracelet/gum
synced 2024-06-15 12:05:36 +02:00
fix: stage all confirmation
This commit is contained in:
parent
214a9f8b88
commit
07dd11fe45
|
@ -10,6 +10,10 @@
|
|||
#
|
||||
# alias gcm='git commit -m "$(gum input)" -m "$(gum write)"'
|
||||
|
||||
if [ -z "$(git status -s -uno | grep -v '^ ' | awk '{print $2}')" ]; then
|
||||
gum confirm "Stage all?" && git add .
|
||||
fi
|
||||
|
||||
TYPE=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert")
|
||||
SCOPE=$(gum input --placeholder "scope")
|
||||
|
||||
|
@ -20,11 +24,5 @@ test -n "$SCOPE" && SCOPE="($SCOPE)"
|
|||
SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this change")
|
||||
DESCRIPTION=$(gum write --placeholder "Details of this change")
|
||||
|
||||
# Check if any staged files are present. If there are non, ask the user if
|
||||
# they want to commit all files
|
||||
if [ -z "$(git status -s -uno | grep -v '^ ' | awk '{print $2}')" ]; then
|
||||
gum confirm "No staged files. Commit all?" && git add .
|
||||
fi
|
||||
|
||||
# Commit these changes if user confirms
|
||||
gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION"
|
||||
|
|
Loading…
Reference in a new issue