diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-25 12:10:00 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-25 12:10:00 +0800 |
| commit | c31f0c502808848bb343646c5e78795b9d5a17ee (patch) | |
| tree | a8e08307a3f1a7703b64465c82b9a42829237da4 | |
| parent | d806d43647094fdd15bdf67166f6ace8fac15620 (diff) | |
chore: improve scripts for gh-pages
| -rwxr-xr-x | scripts/gh-pages.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/gh-pages.sh b/scripts/gh-pages.sh index a091820..02b5d08 100755 --- a/scripts/gh-pages.sh +++ b/scripts/gh-pages.sh | |||
| @@ -1,9 +1,11 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | origin_branch=`git branch --show-current` | ||
| 4 | |||
| 3 | git checkout gh-pages -- .gitignore index.html && \ | 5 | git checkout gh-pages -- .gitignore index.html && \ |
| 4 | npm run build && npm run docs && \ | 6 | npm run build && npm run docs && \ |
| 5 | git branch --force gh-pages HEAD && \ | 7 | git branch --force gh-pages HEAD && \ |
| 6 | git checkout gh-pages && \ | 8 | git checkout gh-pages && \ |
| 7 | git add --all && git commit -m gh-pages && \ | 9 | git add --all && git commit -m gh-pages && \ |
| 8 | git push -f && | 10 | git push -f && |
| 9 | git checkout HEAD^ | 11 | git checkout $origin_branch |