-
Notifications
You must be signed in to change notification settings - Fork 5
/
run
executable file
·45 lines (39 loc) · 1012 Bytes
/
run
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
42
43
44
45
#!/bin/bash
if [[ "$1" == "install" ]]; then
echo "Installing nvm"
scripts/initial_setup.sh
echo "Checking for environment vars and setting up nvm dirs"
source scripts/setup.sh
echo "Installing node"
nvm install 18.14.0
npm install -g [email protected]
echo "Installing typescript"
npm install -g jest typescript ts-jest @types/jest ts-node --save-dev
echo "Installing ts-node"
npm install -g ts-node
echo "Installing all package.json dependencies"
npm install
elif [[ "$1" == "build" ]]; then
echo "Building project"
source scripts/setup.sh
tsc
elif [[ "$1" == "test" ]]; then
echo "Testing with jest"
source scripts/setup.sh
rm -rf coverage
mkdir coverage
npx jest --clearCache
npm run coverage 2> coverage/err
node build/tests/jest_coverage_reporter.js
elif [[ -z "$1" ]]; then
echo "No URL_FILE argument provided!"
exit 1
elif [[ -e "$1" ]]; then
echo "Running with URL_FILE $1"
source scripts/setup.sh
node build/src/index.js $1
exit $?
else
echo "No file exists $1"
exit 1
fi