|
|
|
@ -24,7 +24,7 @@ function _pull { |
|
|
|
|
function _send { |
|
|
|
|
|
|
|
|
|
_status |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "`git status --porcelain`" ] |
|
|
|
|
then |
|
|
|
|
echo -e "\e[0;31m Nothing to commit.\e[0m" |
|
|
|
@ -64,6 +64,44 @@ function _send { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _stage { |
|
|
|
|
|
|
|
|
|
_status |
|
|
|
|
|
|
|
|
|
if [ -z "`git status --porcelain`" ] |
|
|
|
|
then |
|
|
|
|
echo -e "\e[0;31m Nothing to commit.\e[0m" |
|
|
|
|
echo |
|
|
|
|
exit |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo -e "\e[0;32m Going to ADD all and COMMIT.\e[0m" |
|
|
|
|
echo -e "\e[0;32m Enter commit message (leave blank to abort).\e[0m" |
|
|
|
|
echo |
|
|
|
|
echo -n -e "\e[1;36m [msg]: \e[0m" |
|
|
|
|
read msg |
|
|
|
|
echo |
|
|
|
|
|
|
|
|
|
if [ -z "$msg" ] |
|
|
|
|
then |
|
|
|
|
echo -e "\e[0;31m Aborted.\e[0m" |
|
|
|
|
echo |
|
|
|
|
exit |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
echo -e "\e[0;33m> git add --all\e[0m" |
|
|
|
|
echo |
|
|
|
|
git add --all |
|
|
|
|
echo |
|
|
|
|
|
|
|
|
|
echo -e "\e[0;33m> git commit -m \"$msg\"\e[0m" |
|
|
|
|
echo |
|
|
|
|
git commit -m "$msg" |
|
|
|
|
echo |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case $1 in |
|
|
|
|
"check" | "status") |
|
|
|
|
_status |
|
|
|
@ -72,13 +110,23 @@ case $1 in |
|
|
|
|
"pull") |
|
|
|
|
_pull |
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
"send" | "push") |
|
|
|
|
|
|
|
|
|
"send") |
|
|
|
|
_send |
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
*) |
|
|
|
|
echo -e "\n\e[0;31m Invalid ACTION '$1', use one of {check, pull, send} !\e[0m\n"; |
|
|
|
|
"push") |
|
|
|
|
echo -e "\e[0;33m> git push\e[0m" |
|
|
|
|
echo |
|
|
|
|
git push |
|
|
|
|
echo |
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
"stage" | "commit" | "add") |
|
|
|
|
_stage |
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
esac |
|
|
|
|
*) |
|
|
|
|
echo -e "\n\e[0;31m Invalid ACTION '$1', use one of {check/status, pull, send, push, stage/commit} !\e[0m\n"; |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|