-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·45 lines (40 loc) · 913 Bytes
/
build.sh
File metadata and controls
executable file
·45 lines (40 loc) · 913 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
#!/bin/bash
# Charcoal-SE/userscripts build script. Scripts should each have their own directory.
# If a script desires to customise any repo-wide settings, it should have its own
# package.json in the script's directory and the script's directory should be added
# to "ignores" in /package.json.
overridden=""
RED="\033[0;31m"
NORMAL="\033[0m"
for dir in */ ;
do
if [ -f $dir"package.json" ]
then
echo "Overridden package.json: $dir"
overridden=$overridden";;$dir"
fi
done
echo "Building main project..."
npm --no-fund install
npm test
ecode=$?
if [ "$ecode" != "0" ]
then
echo -e "${RED}Exit code${NORMAL}: $ecode"
exit $ecode
fi
dirs=(${overridden//;;/ })
for dir in ${dirs[@]} ;
do
echo "Building overridden: $dir"
cd $dir
npm --no-fund install
npm test
ecode=$?
if [ "$ecode" != "0" ]
then
echo -e "${RED}Exit code${NORMAL}: $ecode"
exit $ecode
fi
cd ..
done