-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·45 lines (36 loc) · 735 Bytes
/
setup.sh
File metadata and controls
executable file
·45 lines (36 loc) · 735 Bytes
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
#!/usr/bin/env bash
config=()
getConfig() {
i=0
while read line
do
config[i]=$line # Put it into the array
i=$(($i + 1))
done < $1
}
getConfig "spark/.setup/config.txt"
echo "executing set up for app ${config[0]}..."
if [[ `hostname -s` = "runnable" ]]
then
echo "...on runnable..."
if [ -e "package.json" ]
then
echo "removing original package.json"
rm package.json
fi
if [ -e "server.js" ]
then
echo "removing original server.js"
rm server.js
fi
mv spark/* .
rm -rf spark
./replace-anchor.js
rm replace-anchor.js
echo "Files relocated to root, installing node packages..."
npm install
rm setup.sh
else
cd spark && npm install
rm setup.sh
fi