summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathew Payne <2772944+GeekMasher@users.noreply.github.com>2023-02-28 00:19:23 +0000
committerGitHub <noreply@github.com>2023-02-27 19:19:23 -0500
commit83db83296a909ccbc2acc7d193083d066540f76d (patch)
treec3f170275a7e6c0e49e0c794c4ad5c0a26d99618
parent46dee843db0cf33d27a688025c6976768d835102 (diff)
Add staged file check for commit example (#269)
* Add staged file check for commit example * fix: stage all confirmation --------- Co-authored-by: Maas Lalani <maas@lalani.dev>
-rwxr-xr-xexamples/commit.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/commit.sh b/examples/commit.sh
index 21c1fc9..29ab94c 100755
--- a/examples/commit.sh
+++ b/examples/commit.sh
@@ -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")