only style-check staged changes (#3186)

pull/3202/head
Lex Neva 2024-09-14 18:56:00 -04:00 zatwierdzone przez GitHub
rodzic 207395d581
commit 832124bc5b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 12 dodań i 5 usunięć

Wyświetl plik

@ -7,11 +7,18 @@
# DO NOT SYMLINK
# DO NOT SYMLINK (why? security risk)
check_errors() {
errors="$("$@")"
if [ "$?" != "0" ]; then
echo "$errors"
exit 1
fi
}
cd $(dirname "$0")/../..
errors=$(git diff --cached | bin/style-check --diff 2>&1)
check_errors git stash --keep-index
check_errors git diff --cached | bin/style-check 2>&1
check_errors git stash pop
if [ "$?" != "0" ]; then
echo "$errors"
exit 1
fi