-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjekyll-cli
More file actions
executable file
·56 lines (45 loc) · 963 Bytes
/
jekyll-cli
File metadata and controls
executable file
·56 lines (45 loc) · 963 Bytes
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /usr/bin/env bash
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $dir
order="$1";
options=(
"serve"
"serve:drafts"
"build:pre"
"build"
)
if [[ -z "$order" ]]; then
echo
echo "JEKYLL CLI"
echo "----------"
echo "What do you want to do?"
i=0;
for opt in "${options[@]}"; do
echo "[$i]: $opt"
i=$((i+1))
done
echo
echo "Enter an option:"
read order
echo
re="^[0-9]*$"
if [[ $order =~ $re ]]; then
order=${options[$order]}
echo $order
fi
fi
if [[ "$order" == "serve" ]]; then
bundle exec jekyll serve -H 0.0.0.0 --livereload -P 8050
elif [[ "$order" == "serve:drafts" ]]; then
bundle exec jekyll serve -H 0.0.0.0 --livereload -P 8050 --drafts
elif [[ "$order" == "build:pre" ]]; then
bundle exec jekyll build
echo
echo "Build success!"
elif [[ "$order" == "build" ]]; then
JEKYLL_ENV=production bundle exec jekyll build # --config _config.pro.yml
echo
echo "Build success!"
else
echo "Unknown command"
fi