mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
d45565f83b
Instead of checking whether it was set previously, setting it to false, then setting it back to true if it was true before, just use the command-line argument in git to override the config for that command. Using a variable makes it pretty painless to do.
25 lines
442 B
Bash
Executable File
25 lines
442 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
gitcmd="git -c commit.gpgsign=false"
|
|
|
|
color() {
|
|
if [ $2 ]; then
|
|
echo -e "\e[$1;$2m"
|
|
else
|
|
echo -e "\e[$1m"
|
|
fi
|
|
}
|
|
colorend() {
|
|
echo -e "\e[m"
|
|
}
|
|
|
|
paperstash() {
|
|
STASHED=$($gitcmd stash 2>/dev/null|| return 0) # errors are ok
|
|
}
|
|
|
|
paperunstash() {
|
|
if [[ "$STASHED" != "No local changes to save" ]] ; then
|
|
$gitcmd stash pop 2>/dev/null|| return 0 # errors are ok
|
|
fi
|
|
}
|