2016-04-10 03:33:32 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-05-24 20:41:50 +02:00
|
|
|
gitcmd="git -c commit.gpgsign=false"
|
|
|
|
|
2016-04-10 03:33:32 +02:00
|
|
|
color() {
|
|
|
|
if [ $2 ]; then
|
|
|
|
echo -e "\e[$1;$2m"
|
|
|
|
else
|
|
|
|
echo -e "\e[$1m"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
colorend() {
|
|
|
|
echo -e "\e[m"
|
|
|
|
}
|
|
|
|
|
|
|
|
paperstash() {
|
2018-05-24 20:41:50 +02:00
|
|
|
STASHED=$($gitcmd stash 2>/dev/null|| return 0) # errors are ok
|
2016-04-10 03:33:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
paperunstash() {
|
|
|
|
if [[ "$STASHED" != "No local changes to save" ]] ; then
|
2018-05-24 20:41:50 +02:00
|
|
|
$gitcmd stash pop 2>/dev/null|| return 0 # errors are ok
|
2016-04-10 03:33:32 +02:00
|
|
|
fi
|
|
|
|
}
|