Skip to content

Commit 4934c8c

Browse files
committed
Update getDependencies to take an argument
1 parent dbaeb91 commit 4934c8c

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

develop.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
bash ./getDependencies.sh ${1}
4+
gatsby develop;

getDependencies.sh

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
BLUE='\033[0;34m'
22
NC='\033[0m' # No Color
33

4+
SPEC_FILE=""
5+
if [ -n ${1} ]; then
6+
SPEC_FILE=${1}
7+
echo $([ -f $SPEC_FILE ])
8+
fi
9+
410
echo
511
echo "${BLUE}Fetching base theme${NC}"
612
if
@@ -9,10 +15,17 @@ if
915
git clone https://github.com/linode/linode-hugo-theme.git;
1016
fi
1117

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+
echo "${BLUE}Using local spec file at: ${SPEC_FILE}${NC}"
21+
cat $SPEC_FILE > static/api/docs/v4/openapi.yaml;
22+
else
23+
echo
24+
echo "${BLUE}Fetching API specs${NC}"
25+
cd -
26+
curl https://raw.githubusercontent.com/linode/linode-api-docs/master/openapi.yaml > static/api/docs/v4/openapi.yaml;
27+
fi
28+
1629

1730
echo
1831
echo "${BLUE}Removing faulty data${NC}"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
],
5151
"scripts": {
5252
"build": "./getDependencies.sh && gatsby build && node search/buildIndex.js",
53-
"develop": "./getDependenciesDevelop.sh && gatsby develop",
53+
"develop": "./develop.sh",
5454
"start": "npm run develop",
5555
"serve": "gatsby serve",
5656
"test": "echo \"Write tests! -> https://gatsby.app/unit-testing\""

0 commit comments

Comments
 (0)