forked from onechiporenko/ember-models-table
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgh-pages.sh
More file actions
executable file
·32 lines (29 loc) · 1.13 KB
/
gh-pages.sh
File metadata and controls
executable file
·32 lines (29 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
if [[ "$1" != "bs3" && "$1" != "bs4" && "$1" != "paper" && "$1" != "plain-html" ]]; then
echo 'Framework is not set. Allowed values: "bs3", "bs4", "paper", "plain-html"';
exit 1;
fi
sed -i "s|.*ENV\.rootURL.*|\t\tENV.rootURL = '/ember-models-table/v.3/$1/';|" ./tests/dummy/config/environment.js
sed -i "s|.*const {.*| const uiFramework = '$1';|" ./tests/dummy/app/instance-initializers/emt-inject.js
npm run build:gh-pages:$1
git checkout ./tests/dummy/config/environment.js
git checkout ./tests/dummy/app/instance-initializers/emt-inject.js
git checkout gh-pages
# from https://stackoverflow.com/questions/37890510/bash-script-to-check-if-the-current-git-branch-x
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$BRANCH" != "gh-pages" ]]; then
echo 'Current branch is not "gh-pages"';
exit 1;
fi
git rm -rf app addon config tests blueprints
git rm -rf package.json package-lock.json testem.json
git rm -rf .editorconfig .jshintrc .travis.yml
git rm -rf "v.3/$1"
mkdir ./v.3
mkdir "./v.3/$1"
mv dist/* "./v.3/$1"
rm -rf dist
git add v.3
git commit -m "Pushing $1 v.3 to github pages"
git push origin gh-pages
git checkout master