rework building templates

This commit is contained in:
Conduitry
2019-09-26 04:49:31 -04:00
parent 190168b8a1
commit 14cbe7caae
5 changed files with 40 additions and 57 deletions

View File

@@ -1,31 +1,25 @@
#!/bin/bash
cd "$(dirname $0)"/..
cd "$(dirname "$0")"/..
DEFAULT=${1:-master}
ROLLUP=${2:-rollup}
WEBPACK=${3:-webpack}
HEAD=$(git rev-parse HEAD)
echo "Creating $ROLLUP and $WEBPACK branches from $DEFAULT"
ROLLUP=${1:-rollup}
WEBPACK=${2:-webpack}
# make sure we're on master, and delete the $ROLLUP and $WEBPACK branches
git symbolic-ref HEAD "refs/heads/$DEFAULT"
git reset --hard
git branch -D $ROLLUP $WEBPACK
echo "Creating $ROLLUP and $WEBPACK branches from $REV"
# create the $ROLLUP branch off the current master
git checkout -b $ROLLUP
# create the $ROLLUP branch off the current HEAD
git symbolic-ref HEAD refs/heads/$ROLLUP
git reset $HEAD --hard
node _template/build-pkg.js rollup
git rm -r --cached .travis.yml _template package_template.json webpack.config.js
git rm -r --cached .github _template package_template.json webpack.config.js
git add package.json
git commit -m 'Sapper template for Rollup'
git symbolic-ref HEAD "refs/heads/$DEFAULT"
git reset --hard
# create the $WEBPACK branch off the current master
git checkout -b $WEBPACK
# create the $WEBPACK branch off the current HEAD
git symbolic-ref HEAD refs/heads/$WEBPACK
git reset $HEAD --hard
node _template/build-pkg.js webpack
git rm -r --cached .travis.yml _template package_template.json rollup.config.js
git rm -r --cached .github _template package_template.json rollup.config.js
git add package.json
git commit -m 'Sapper template for webpack'
git symbolic-ref HEAD "refs/heads/$DEFAULT"
git reset --hard