aboutsummaryrefslogtreecommitdiffstats
path: root/gen_docs.sh
diff options
context:
space:
mode:
authorJonathan Zacsh2012-08-27 14:10:28 -0400
committerMisko Hevery2012-08-30 22:33:30 -0700
commitb12d1b68131dd538b34a9cd72011f37722b90b28 (patch)
treefb73d21588f4af1fd4084af7d83e0398e653ee66 /gen_docs.sh
parentacb499f820977df620fd5314c7dea9dd6bd51a10 (diff)
downloadangular.js-b12d1b68131dd538b34a9cd72011f37722b90b28.tar.bz2
fix(docs): Making sure gen_docs.sh looks for a globally installed copy of jasmine-node as well as local.
Diffstat (limited to 'gen_docs.sh')
-rwxr-xr-xgen_docs.sh22
1 files changed, 19 insertions, 3 deletions
diff --git a/gen_docs.sh b/gen_docs.sh
index 9ddb82aa..92817c5a 100755
--- a/gen_docs.sh
+++ b/gen_docs.sh
@@ -1,4 +1,20 @@
-#!/bin/bash
-if [ ! -e gen_docs.disable ]; then
- ./node_modules/.bin/jasmine-node docs/spec --noColor && node docs/src/gen-docs.js
+#!/usr/bin/env bash
+
+JASMINE_NODE='jasmine-node'
+if ! type -p "$JASMINE_NODE" >/dev/null 2>&1;then
+ # Locally (npm)-installed jasmine-node
+ local_jasmine='./node_modules/.bin/jasmine-node'
+
+ if [[ -x "$local_jasmine" ]];then
+ JASMINE_NODE="$local_jasmine"
+ else
+ echo 'Could not find a locally or globally installed executable of' \
+ 'jasmine-node. Try: `npm install jasmine-node`.' >&2
+ exit 1
+ fi
+fi
+
+if [[ ! -e gen_docs.disable ]]; then
+ echo 'Testing, then building documentation...'
+ "$JASMINE_NODE" docs/spec --noColor && node docs/src/gen-docs.js
fi