Created
July 17, 2020 16:24
-
-
Save shannonwells/9d26c3cf10bfbe199ea11bc4580e431c to your computer and use it in GitHub Desktop.
A git update script for a nodejs project
This file contains hidden or 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/bash | |
# emojis help instantly recognize something went wrong and where | |
function exit_err() { echo "❌ 💔" ; exit 1; } | |
set -Euo pipefail | |
echo "Updating your repo." | |
echo "☕️ Take a break - this might take a few minutes." | |
git stash | |
git co master -q | |
git pull origin master --ff-only -q | |
git fetch --prune -q | |
npm install || exit_err() | |
npm run build || exit_err() | |
echo "🍩 Done." # have a donut - everyone needs a donut sometimes | |
echo $'\a' # a beep in case you weren't paying attention |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment