-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bash
executable file
·48 lines (46 loc) · 939 Bytes
/
build.bash
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
46
47
48
#!/bin/bash
(set -o igncr) 2>/dev/null && set -o igncr; # For Cygwin on Windows compaibility
bash clean.bash
./node_modules/.bin/tsc
if [ $? != 0 ]; then
bash clean.bash
exit 1
fi
mkdir dist
cd src
for d in */ ; do
cd $d
if [ -f "build.sh" ]; then
sh build.sh
fi
if [ -f "build.bash" ]; then
bash build.bash
fi
if [ $? != 0 ]; then
cd ../
cd ../
bash clean.bash
exit 1
fi
cd ../
done
for d in */ ; do
cd $d
if [ -d "dist" ]; then
cd dist
for f in *; do
resFileName=$(echo $d $f | awk '{gsub("dist",$1,$2);gsub("/","",$2);print $2;}')
cp * ../../../dist/$resFileName
done
cd ../
fi
cd ../
done
cd ../
rsync -vr --exclude '*.md' dist/* dep/
rsync -vr res/* dep/
for f in $(find src -name '*.ts');
do
artifact=$(echo $f | awk '{gsub("\\.ts",".js");print}')
rm $artifact
done