mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
Fix stash handling in deploy script
This commit is contained in:
parent
759310a2a6
commit
bc2a5655d8
1 changed files with 4 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ RESET='\033[0m'
|
|||
# Fail if the `heroku` remote isn't there.
|
||||
git remote show heroku
|
||||
|
||||
git stash # Stash uncommitted changes.
|
||||
STASH_OUTPUT=$(git stash) # Stash uncommitted changes.
|
||||
git checkout -B deploy # Force branch creation/reset.
|
||||
npm run build
|
||||
git add -f lib # Force add ignored files.
|
||||
|
|
@ -17,6 +17,8 @@ git push -f heroku deploy:master
|
|||
git rm -r --cached lib # Otherwise switching branches will remove them.
|
||||
git checkout - # Switch back to whatever branch we came from.
|
||||
git branch -D deploy # Just to prevent someone accidentally pushing to GitHub.
|
||||
git stash pop --index || true # Restore uncommitted changes, OK if none.
|
||||
if [[ $STASH_OUTPUT != "No local changes"* ]]; then
|
||||
git stash pop --index # Restore uncommitted changes.
|
||||
fi
|
||||
|
||||
echo -e "\n${GREEN}✔︎ Successfully deployed.${RESET}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue