tui-scripts/g

29 lines
937 B
Plaintext
Raw Permalink Normal View History

2024-03-16 15:34:40 +00:00
#!/bin/bash
set -e
2024-03-29 06:50:32 +00:00
trap 'clear' SIGINT
2024-03-16 15:34:40 +00:00
cat > /tmp/.dialogrc << EOL
# Item color
tag_color = (BLACK,WHITE,ON)
EOL
set +ex
2024-03-29 07:23:10 +00:00
action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for git" 10 40 0 'Add all && Commit && Push' 1 "Add all" 2 "Commit" 3 "Push" 4 "Status" 5)
2024-03-16 15:34:40 +00:00
#echo $action
#exit
if [[ $action == "Add all && Commit && Push" ]]; then
git add .
commit_message=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --title "$action" --inputbox "Enter the commit message:" 8 40)
git commit -"m $commit_message"
git push
elif [[ $action == "Add all" ]]; then
git add .
elif [[ $action == "Commit" ]]; then
commit_message=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --title "$action" --inputbox "Enter the commit message:" 8 40)
git commit -"m $commit_message"
elif [[ $action == "Push" ]]; then
git push
2024-03-29 07:23:10 +00:00
elif [[ $action == "Status" ]]; then
git status
2024-03-16 15:34:40 +00:00
fi