File tree Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ bash ./getDependencies.sh ${1}
4
+ gatsby develop;
Original file line number Diff line number Diff line change 1
1
BLUE=' \033[0;34m'
2
2
NC=' \033[0m' # No Color
3
3
4
+ SPEC_FILE=" "
5
+ if [ -n ${1} ]; then
6
+ SPEC_FILE=${1}
7
+ echo $( [ -f $SPEC_FILE ])
8
+ fi
9
+
4
10
echo
5
- echo " ${BLUE} Fetching base theme${NC} "
11
+ printf " ${BLUE} Fetching base theme${NC} \n "
6
12
if
7
13
cd linode-hugo-theme; then
8
14
git pull origin development; else
9
15
git clone https://github.com/linode/linode-hugo-theme.git;
10
16
fi
11
17
12
- echo
13
- echo " ${BLUE} Fetching API specs${NC} "
14
- cd -
15
- curl https://raw.githubusercontent.com/linode/linode-api-docs/master/openapi.yaml > static/api/docs/v4/openapi.yaml
18
+ if [ -f " $SPEC_FILE " ]; then
19
+ echo
20
+ printf " ${BLUE} Using local spec file at: ${SPEC_FILE}${NC} \n"
21
+ cat $SPEC_FILE > static/api/docs/v4/openapi.yaml;
22
+ else
23
+ echo
24
+ printf " ${BLUE} Fetching API specs${NC} \n"
25
+ cd -
26
+ curl https://raw.githubusercontent.com/linode/linode-api-docs/master/openapi.yaml > static/api/docs/v4/openapi.yaml;
27
+ fi
28
+
16
29
17
30
echo
18
- echo " ${BLUE} Removing faulty data${NC} "
31
+ printf " ${BLUE} Removing faulty data${NC} \n "
19
32
sed -i.bak ' /backgroundColor:/d' static/api/docs/v4/openapi.yaml
20
33
rm static/api/docs/v4/openapi.yaml.bak
21
34
22
35
echo
23
- echo " ${BLUE} Converting YAML to JSON${NC} "
24
- ./ node_modules/yamljs/bin/yaml2json static/api/docs/v4/openapi.yaml > static/api/docs/v4/spec.json
36
+ printf " ${BLUE} Converting YAML to JSON${NC} \n "
37
+ node_modules/yamljs/bin/yaml2json static/api/docs/v4/openapi.yaml > static/api/docs/v4/spec.json
Original file line number Diff line number Diff line change 50
50
],
51
51
"scripts" : {
52
52
"build" : " ./getDependencies.sh && gatsby build && node search/buildIndex.js" ,
53
- "develop" : " ./getDependencies .sh && gatsby develop " ,
53
+ "develop" : " ./develop .sh" ,
54
54
"start" : " npm run develop" ,
55
55
"serve" : " gatsby serve" ,
56
56
"test" : " echo \" Write tests! -> https://gatsby.app/unit-testing\" "
You can’t perform that action at this time.
0 commit comments