28 lines
798 B
Bash
28 lines
798 B
Bash
|
#!/bin/bash
|
||
|
case $1 in
|
||
|
check_error)
|
||
|
result="$(/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME status --short 2> /dev/null)"
|
||
|
if [[ $? -ne 0 ]]; then
|
||
|
echo YES
|
||
|
fi
|
||
|
;;
|
||
|
check_status)
|
||
|
result="$(/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME status --short 2> /dev/null)"
|
||
|
if [[ ! -z "$result" ]]; then
|
||
|
echo YES
|
||
|
fi
|
||
|
;;
|
||
|
|
||
|
check_push)
|
||
|
result="$(/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME status --short 2> /dev/null)"
|
||
|
if [[ -z "$result" ]]; then
|
||
|
result="$(/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME cherry -v origin/master)"
|
||
|
if [[ ! -z "$result" ]]; then
|
||
|
echo YES
|
||
|
fi
|
||
|
fi
|
||
|
;;
|
||
|
|
||
|
esac
|
||
|
|