Added dotfiles car to gbt

This commit is contained in:
Jonas Forsberg 2020-03-30 10:24:49 +02:00
parent 4ee3aad8af
commit c8e9d4279d
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9

View File

@ -0,0 +1,27 @@
#!/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