Created
April 5, 2022 06:46
-
-
Save WeslyG/1e7c2c753f369e5294acf7e25b2073d2 to your computer and use it in GitHub Desktop.
powershell pre-commit hook with sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
tscCommand="powershell.exe yarn tsc" | |
lintCommand="powershell.exe yarn lint" | |
echo "[HOOK] Running tsc..." | |
q=$(exec $tscCommand) | |
result=$? | |
if [ "$result" != "0" ] | |
then | |
echo "===================" | |
echo "| |" | |
echo "[HOOK] TSC failed!" | |
echo "| |" | |
echo "===================" | |
exit 1 | |
fi | |
echo "[HOOK] Running lint..." | |
z=$(exec $lintCommand) | |
result2=$? | |
if [ "$result2" != "0" ] | |
then | |
echo "===================" | |
echo "| |" | |
echo "[HOOK] lint failed!" | |
echo "| |" | |
echo "===================" | |
exit 1 | |
fi | |
echo "=====================================" | |
echo "= =" | |
echo "= [HOOK] All linter passed success! =" | |
echo "= =" | |
echo "=====================================" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment