forked from telerik/docs-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
modify-config.sh
64 lines (55 loc) · 1.2 KB
/
modify-config.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
for i in "$@"
do
case $i in
-i=*|--include=*)
INCLUDE="${i#*=}"
shift
;;
-s=*|--serve=*)
SERVE="${i#*=}"
shift
;;
-c=*|--config=*)
CONFIG="${i#*=}"
shift
;;
-d=*|--docker=*)
DOCKER="${i#*=}"
shift
;;
--default)
DEFAULT=YES
shift
;;
*)
;;
esac
done
# echo 'Debug arguments:'
# echo "INCLUDE = ${INCLUDE}"
# echo "SERVE = ${SERVE}"
# echo "SECOND CONFIG = ${CONFIG}"
# echo "USING DOCKER = ${DOCKER}"
# exit
config_file="_config.yml"
if [ ! -z $CONFIG ]
then
config_file+=",$CONFIG"
fi
reserved_folders=".asset-cache,_assets,_common,_data,_includes,_layouts,_plugins,_templates,docs-watcher,fonts,styles"
include_folders=
echo 'Generating config...'
./_build/tools/ConfigGenerator.exe --include=$INCLUDE --reserved=$reserved_folders --config=_config.yml
tempconfig="_tempconfig.yml"
config_file+=",$tempconfig"
echo "Using config_file: $config_file"
#bundle exec jekyll serve --config=$config_file
if [[ $SERVE == "true" ]];then
bundle exec jekyll serve --config=$config_file
elif [[ $DOCKER == "true" ]]
then
sh start-docs.sh $tempconfig
else
bundle exec jekyll build --config=$config_file
fi