Added a few scripts to make my life a tiny bit easier; updated some things (i forgor)
This commit is contained in:
parent
7ac1098ec5
commit
c4ebdccebe
6 changed files with 62 additions and 11 deletions
34
zgit
Executable file
34
zgit
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/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 ]; 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))
|
||||
Loading…
Reference in a new issue