forked from acumenbrands/rest_suite
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jspec
executable file
·41 lines (33 loc) · 1.09 KB
/
jspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NODE_MODULES_DIRECTORY=node_modules
if [[ $@ =~ "--help" ]]; then
echo "sources say no"
exit
fi
if [[ $@ =~ "--doc" ]]; then
echo "Generating documentation..."
node_modules/jsdoc/./jsdoc -l -d doc/ ./lib/*.js README.md
node_modules/jsdoc/./jsdoc -l -d doc/netsuite ./doc/netsuite/*.js ./doc/netsuite/README.md
exit
fi
if [[ $@ =~ "--reset" ]]; then
echo "Removing installed node moldules from "$DIR"/node_modules..."
rm -r $DIR"/node_modules"
fi
if ! command -v npm &>/dev/null; then
echo "npm command not found, pleace ensure node package manager is installed and in your path." 1>&2
exit 1
fi
if [ ! -d "${NODE_MODULES_DIRECTORY}" ]; then
echo "No node modules directory found locally, running 'npm install'..."
npm install
fi
if [[ $@ =~ "--mono" ]]; then
./node_modules/jasmine-node/bin/jasmine-node --forceexit --noColor spec
fi
if [[ $@ =~ "--debug" ]]; then
node debug ./node_modules/jasmine-node/bin/jasmine-node --forceexit spec
else
./node_modules/jasmine-node/bin/jasmine-node --forceexit spec
fi