Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 11:00:06 +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 Zeilen
442 B
Bash
Ausführbare Datei
25 Zeilen
442 B
Bash
Ausführbare Datei
#!/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
|
|
}
|