Skip to content

Commit 792edca

Browse files
authored
Merge pull request linode#145 from stvnjacobs/feature/development-spec-build
build site with development spec on development
2 parents 81aeb16 + 37df2fc commit 792edca

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

getDependencies.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
#!/usr/bin/env bash
2+
13
BLUE='\033[0;34m'
24
NC='\033[0m' # No Color
35

6+
SPEC_BRANCH="master"
7+
if [[ "$GIT_LOCAL_BRANCH" =~ ^(master|development)$ ]]; then
8+
SPEC_BRANCH="${GIT_LOCAL_BRANCH}"
9+
fi
10+
411
SPEC_FILE=""
512
if [ -n ${1} ]; then
613
SPEC_FILE=../${1}
@@ -24,7 +31,7 @@ else
2431
echo
2532
printf "${BLUE}Fetching API specs${NC}\n"
2633
cd -
27-
curl https://raw.githubusercontent.com/linode/linode-api-docs/master/openapi.yaml > static/api/docs/v4/openapi.yaml;
34+
curl "https://raw.githubusercontent.com/linode/linode-api-docs/${SPEC_BRANCH}/openapi.yaml" > static/api/docs/v4/openapi.yaml;
2835
fi
2936

3037
echo
@@ -37,4 +44,4 @@ printf "${BLUE}Converting YAML to JSON${NC}\n"
3744
node_modules/yamljs/bin/yaml2json static/api/docs/v4/openapi.yaml > static/api/docs/v4/spec.json
3845
# some data manipulation to fix the result of the conversion above
3946
sed -i.bak 's@\\\\[[:space:]]@\\\\\\n @g' static/api/docs/v4/spec.json
40-
rm static/api/docs/v4/spec.json.bak
47+
rm static/api/docs/v4/spec.json.bak

0 commit comments

Comments
 (0)