From e0beb050fdc3c1c5073cf7cf2c918980a9a31774 Mon Sep 17 00:00:00 2001 From: Maas Lalani Date: Wed, 27 Jul 2022 18:45:59 -0400 Subject: [PATCH] docs: note on `gum confirm` exit codes --- README.md | 3 ++- examples/commit.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b732679..dab0afc 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ gum write --placeholder "Details of this change" ``` Prompt for a confirmation before committing: +> `gum confirm` exits with status `0` if confirmed and status `1` if cancelled. ```bash gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION" @@ -84,7 +85,7 @@ DESCRIPTION=$(gum write --placeholder "Details of this change") gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION" ``` -Running the ./examples/commit.sh script to commit to git +Running the ./examples/commit.sh script to commit to git ## Installation diff --git a/examples/commit.sh b/examples/commit.sh index 95c34ef..f97a4b6 100755 --- a/examples/commit.sh +++ b/examples/commit.sh @@ -21,4 +21,4 @@ SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this chang DESCRIPTION=$(gum write --placeholder "Details of this change") # Commit these changes if user confirms -gum confirm && git commit -m "$SUMMARY" -m "$DESCRIPTION" +gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION"