-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.sh
executable file
·37 lines (29 loc) · 893 Bytes
/
run.sh
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
33
34
35
36
37
#!/bin/bash
cd $PWD
set -e
script_name=$(basename $0 | sed "s/\.sh$//")
if [ "$1" == "--help" ] || [ "$1" == "-h" ] || [ "$1" == "help" ]; then
echo "Setup and run Jekyll"
echo ""
echo "Usage: ${script_name} [option]"
echo ""
echo "Options are not mandatory, only one at a time."
echo "-a, --assets Build minimized css style and js script from sources."
echo "-i, --install Install Bundler and node modules using Yarn."
echo "-I, --incremental Runs Jekyll in incremental mode."
echo ""
exit 0
fi
if [ "$1" == "-i" ] || [ "$1" == "--install" ]; then
gem update
gem install bundler
bundle install
yarn --no-bin-links
fi
if [ ! -f "assets/css/style.min.css" ] || [ "$1" == "-a" ] || [ "$1" == "--assets" ]; then
yarn dist
fi
if [ "$1" == "-I" ] || [ "$1" == "--incremental" ]; then
incremental="-I"
fi
bundle exec jekyll serve --watch --host=0.0.0.0 $incremental