-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate
executable file
·50 lines (46 loc) · 1.45 KB
/
update
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
49
50
#!/bin/bash
airborn_src=`[ $1 ] && echo file://$(readlink -m $1) || echo https://github.com/twiss/airborn.git`
firetext_src=`[ $2 ] && echo file://$(readlink -m $2) || echo https://github.com/codexa/firetext.git`
strut_src=`[ $3 ] && echo file://$(readlink -m $3) || echo https://github.com/twiss/Strut.git`
maxprocs=$(( $(nproc --all) - 1 ))
CjC=$2/builder/node_modules/google-closure-compiler/compiler.jar
function CjC {
nice -20 java -jar $CjC --language_in ECMASCRIPT6 --language_out ECMASCRIPT5 $1 --warning_level QUIET --js_output_file $1~ &&
mv $1~ $1 &&
echo Compiled $1
}
export CjC
export -f CjC
(
echo Updating Firetext from $firetext_src
rm -rf firetext &&
git clone -q --depth 1 --recursive $firetext_src firetext &&
rm -rf firetext/.git &&
[ "$4" != "--build" ] ||
(
echo "Building Firetext..." &&
firetext/builder/build --airborn &&
rm -rf $(find firetext -mindepth 1 -maxdepth 1 | grep -v build$) &&
cp -r firetext/build/* firetext &&
rm -rf firetext/build
)
) &&
(
echo Updating Airborn from $airborn_src
rm -rf airborn &&
git clone -q --depth 1 --recursive $airborn_src airborn &&
rm -rf airborn/.git &&
[ "$4" != "--build" ] ||
(
echo "Building Airborn OS..." &&
find airborn -name "*.js" ! -name "*.min.js" | xargs -n1 -P $maxprocs -I{} bash -c "CjC {}"
)
) &&
(
echo Updating Strut from $strut_src
rm -rf strut &&
git clone -q --depth 1 --recursive $strut_src strut &&
rm -rf strut/.git
) &&
npm install &&
node update.js