forked from Genivia/SJOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·27 lines (19 loc) · 965 Bytes
/
build.sh
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
#!/bin/bash
# get version after version bump
VERSION=`npm list --depth=0 | sed -n 's/^[^@]*@\([^ ]*\) .*$/\1/p'`
echo "Creating sjot $VERSION"
cd dev
# bump version and remove DEBUG[ ... DEBUG]
sed -e "s/{VERSION}/$VERSION/" -e "s/DEBUG\[.*DEBUG\]//g" -e "/DEBUG\[/,/DEBUG\]/ d" < sjot.js > ../dist/sjot.js
# sjot-fast.js removes FAST[ ... FAST]
sed -e "s/FAST\[.*FAST\]//g" -e "/FAST\[/,/FAST\]/ d" < ../dist/sjot.js > ../dist/sjot-fast.js
# sjot-lean.js removes LEAN[ ... LEAN]
sed -e "s/LEAN\[.*LEAN\]//g" -e "/LEAN\[/,/LEAN\]/ d" < ../dist/sjot.js > ../dist/sjot-lean.js
# sjot-mean.js removes FAST[ ... FAST] and LEAN[ ... LEAN]
sed -e "s/LEAN\[.*LEAN\]//g" -e "/LEAN\[/,/LEAN\]/ d" < ../dist/sjot-fast.js > ../dist/sjot-mean.js
# create index.js by adding module.exports
cp -f ../dist/sjot.js ../index.js
echo 'module.exports = SJOT;' >> ../index.js
# create travis-test.js
cp -f ../dist/sjot.js ../travis-test.js
tail +2 test.js >> ../travis-test.js