Skip to content

Commit b12d1b6

Browse files
jzacshmhevery
authored andcommitted
fix(docs): Making sure gen_docs.sh looks for a globally installed copy of jasmine-node as well as local.
1 parent acb499f commit b12d1b6

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

gen_docs.sh

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
#!/bin/bash
2-
if [ ! -e gen_docs.disable ]; then
3-
./node_modules/.bin/jasmine-node docs/spec --noColor && node docs/src/gen-docs.js
1+
#!/usr/bin/env bash
2+
3+
JASMINE_NODE='jasmine-node'
4+
if ! type -p "$JASMINE_NODE" >/dev/null 2>&1;then
5+
# Locally (npm)-installed jasmine-node
6+
local_jasmine='./node_modules/.bin/jasmine-node'
7+
8+
if [[ -x "$local_jasmine" ]];then
9+
JASMINE_NODE="$local_jasmine"
10+
else
11+
echo 'Could not find a locally or globally installed executable of' \
12+
'jasmine-node. Try: `npm install jasmine-node`.' >&2
13+
exit 1
14+
fi
15+
fi
16+
17+
if [[ ! -e gen_docs.disable ]]; then
18+
echo 'Testing, then building documentation...'
19+
"$JASMINE_NODE" docs/spec --noColor && node docs/src/gen-docs.js
420
fi

0 commit comments

Comments
 (0)