You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 lines
1.1 KiB

#!/bin/bash
git add .
printf "Enter commit message: "
read message
git commit -m "$message" --dry-run
read -p "Are you sure you want to commit these changes? [yn]: " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
printf "\nCommitting changes...\n"
node ./scripts/import-emoji-paths.js
git add .
git commit -m "$message"
read -p "Push changes? [yn]: " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
printf "\nTo where?\n"
read -p 'Remote: ' remote
read -p 'Branch: ' branch
printf "Pushing changes...\n"
git push -u $remote $branch
elif [[ $REPLY =~ ^[Nn]$ ]]
then
printf "\nNot pushing committed changes, exiting..."
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
else
printf "\nUnexpected argument, not pushing committed changes, exiting..."
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi
elif [[ $REPLY =~ ^[Nn]$ ]]
then
printf "\nExiting..."
git reset
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
else
printf "\nUnexpected argument, exiting..."
git reset
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi