gum/examples/git-stage.sh

13 lines
271 B
Bash
Raw Normal View History

2022-08-02 19:56:40 +02:00
#!/bin/bash
ADD="Add"
RESET="Reset"
ACTION=$(gum choose "$ADD" "$RESET")
if [ "$ACTION" == "$ADD" ]; then
git status --short | cut -c 4- | gum choose --no-limit | xargs git add
else
git status --short | cut -c 4- | gum choose --no-limit | xargs git restore
fi