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