mirror of
https://github.com/charmbracelet/gum
synced 2024-05-26 18:32:26 +02:00
docs: note on gum confirm
exit codes
This commit is contained in:
parent
d80b425e80
commit
e0beb050fd
|
@ -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"
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/commit_1.gif" width="600" alt="Running the ./examples/commit.sh script to commit to git" />
|
||||
<img src="https://stuff.charm.sh/gum/commit_2.gif" width="600" alt="Running the ./examples/commit.sh script to commit to git" />
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue