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
|
2020-11-29 07:24:39 +01:00
|
|
|
printf "\e[$1;$2m"
|
2016-04-10 03:33:32 +02:00
|
|
|
else
|
2020-11-29 07:24:39 +01:00
|
|
|
printf "\e[$1m"
|
2016-04-10 03:33:32 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
colorend() {
|
2020-11-29 07:24:39 +01:00
|
|
|
printf "\e[m"
|
2016-04-10 03:33:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|