mirror of
https://github.com/charmbracelet/gum
synced 2024-06-04 23:02:16 +02:00
docs: add gum confirm
to commit.sh script
This commit is contained in:
parent
bb3fbab70d
commit
d80b425e80
10
README.md
10
README.md
|
@ -60,6 +60,12 @@ Prompt for a detailed (multi-line) explanation of the changes:
|
|||
gum write --placeholder "Details of this change"
|
||||
```
|
||||
|
||||
Prompt for a confirmation before committing:
|
||||
|
||||
```bash
|
||||
gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION"
|
||||
```
|
||||
|
||||
Putting it all together...
|
||||
|
||||
```bash
|
||||
|
@ -75,10 +81,10 @@ SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this chang
|
|||
DESCRIPTION=$(gum write --placeholder "Details of this change")
|
||||
|
||||
# Commit these changes
|
||||
git commit -m "$SUMMARY" -m "$DESCRIPTION"
|
||||
gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION"
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/commit.gif" width="600" alt="Running the ./examples/commit.sh script to commit to git" />
|
||||
<img src="https://stuff.charm.sh/gum/commit_1.gif" width="600" alt="Running the ./examples/commit.sh script to commit to git" />
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
|
@ -20,5 +20,5 @@ SCOPE=$(gum input --placeholder "scope")
|
|||
SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this change")
|
||||
DESCRIPTION=$(gum write --placeholder "Details of this change")
|
||||
|
||||
# Commit these changes
|
||||
git commit -m "$SUMMARY" -m "$DESCRIPTION"
|
||||
# Commit these changes if user confirms
|
||||
gum confirm && git commit -m "$SUMMARY" -m "$DESCRIPTION"
|
||||
|
|
Loading…
Reference in a new issue