Created
July 22, 2022 21:08
-
-
Save JamesMcMahon/25f25bed48a8de9d20c58262123fffcf to your computer and use it in GitHub Desktop.
Pre-push script for local CI
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
#!/usr/bin/env sh | |
set -e | |
echo "Running pre-push hook..." | |
git fetch | |
if ! git diff-index --quiet HEAD --; then | |
echo "Local changes found, please commit or stash" | |
exit 1 | |
fi | |
if ! test -z "$(git ls-files --exclude-standard --others)"; then | |
echo "Untracked files, please commit or remove" | |
exit 1 | |
fi | |
if ! git diff --quiet $(git branch --show-current)..origin/$(git branch --show-current) -- frontend/; then | |
echo "Verifying Frontend" | |
cd frontend | |
npm run verifyAndBuild | |
cd .. | |
else | |
echo "No Changes detected in Frontend, skipping verify" | |
fi | |
if ! git diff --quiet $(git branch --show-current)..origin/$(git branch --show-current) -- everyone-parser/; then | |
echo "Verifying Parser" | |
cd everyone-parser | |
npm run verifyAndBuild | |
cd .. | |
else | |
echo "No Changes detected in Parser, skipping verify" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment