Created
August 15, 2017 08:16
-
-
Save chaosmail/f3f2784b9e32f1c78894d63bf1ae2d45 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
set -e | |
currentVersion=`cat package.json | grep version | sed 's/[",:]//g' | awk '{print $2}'` | |
npm install | |
npm run compile | |
git checkout --orphan "build-$currentVersion" | |
find . -maxdepth 1 -type d -not -name "build" -not -name "docs" -not -name ".*" -exec rm -rf {} \; | |
find . -maxdepth 1 -type f -not -name "LICENSE" -not -name "README.md" -exec rm -f {} \; | |
git add . | |
git commit -a -m 'Update build files' | |
git push -f origin "build-$currentVersion" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment