Watch
1
0
Fork
You've already forked Zoe-Dotfiles
0
mirror of synced 2026-11-03 19:57:17 +00:00
Zoe-Dotfiles/zgit
2026-10-02 00:23:02 +02:00

34 lines
684 B
Shell
Executable file

#!/bin/bash
# This is just to update my git repo a tiny bit faster
usage() { echo "Usage: $0 [-a \"<string>\"] [-s <file>]" 1>&2; exit 1; }
while getopts "a:s:" o; do
case "${o}" in
a)
a=${OPTARG}
git add .
git commit -m "$a"
git push
exit 0
;;
s)
s=${OPTARG}
if [ -f $s ] || [ -d $s ]; then
git add $s
read -p "Commit message: " commitMsg
tmp="${commitMsg%\"}"
tmp="${tmp#\"}"
git commit -m "$tmp"
git push
else
echo "$s is not a regular file!"
exit 1
fi
;;
*)
usage
;;
esac
done
#shift $((OPTIND-1))