3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 11:00:06 +01:00
Paper/scripts/functions.sh
Shane Freeder bfa122ae6a [CI-SKIP] Misc script changes (Closes #4346)
testserver - use printf instead of echo, as echo is apparently
              inconsistent across environments
requireDeps - change message slightly, maybe more useful to people?
2020-11-29 06:24:39 +00:00

25 Zeilen
439 B
Bash
Ausführbare Datei

#!/usr/bin/env bash
gitcmd="git -c commit.gpgsign=false"
color() {
if [ $2 ]; then
printf "\e[$1;$2m"
else
printf "\e[$1m"
fi
}
colorend() {
printf "\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
}