Commit 86b90a2768

86b90a2768ba25c62333c2c83d96a675244d4a4f

parent: 9007704c4b

Unsigned

cmc <hello@cleberg.net> · 2024-10-31 14:57 UTC

enhance build script

Layout: unified · split

build.sh +12 −15
@@ -3,22 +3,19 @@
3printf "Did you update the 'Recent Blog Posts' section? [yn] " 3printf "Did you update the 'Recent Blog Posts' section? [yn] "
4read answer 4read answer
5 5
6if [ "$answer" != "${answer#[Yy]}" ] ; then 6if [[ "$answer" =~ ^[Yy]$ ]]; then
7 if [ "$ENV" == "prod" ]; then 7 if [[ "$ENV" == "prod" ]]; then
8 echo "Environment: Production" && \ 8 echo "Environment: Production"
9 rm -rf .build/* && \ 9 rm -rf .build/*
10 emacs --script publish.el &>/dev/null && \ 10 emacs --script publish.el &>/dev/null
11 minify -o theme/static/styles.min.css \ 11 minify -o theme/static/styles.min.css theme/static/styles.css
12 theme/static/styles.css && \ 12 rsync -r --delete-before .build/* ubuntu:/var/www/cleberg.net/
13 rsync -r --delete-before .build/* \
14 ubuntu:/var/www/cleberg.net/
15 else 13 else
16 echo "Environment: Development" && \ 14 echo "Environment: Development"
17 rm -rf .build/* && \ 15 rm -rf .build/*
18 emacs --script publish.el && \ 16 emacs --script publish.el
19 minify -o theme/static/styles.min.css \ 17 minify -o theme/static/styles.min.css theme/static/styles.css
20 theme/static/styles.css && \ 18 cd .build/
21 cd .build/ && \
22 python3 -m http.server 19 python3 -m http.server
23 fi 20 fi
24else 21else