aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorRuben Rodriguez <ruben@gnu.org>2018-10-03 22:23:57 +0000
committerRuben Rodriguez <ruben@gnu.org>2018-10-03 22:23:57 +0000
commitdcba303f8d172f6748225d2e00f28a44ac13c453 (patch)
treed03607192a35e21a65fe1972f57bc273c53a25bb /build.sh
parent5461a48cbeac01d5f8bc31a10d11ff72a295c7d9 (diff)
parent12bfe0f9fdad5bfea680d897c81319684ee82180 (diff)
Merge #25 `Adding automated test suite`
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 1e07fcb..0cd41d7 100755
--- a/build.sh
+++ b/build.sh
@@ -1,6 +1,16 @@
PATH=$PATH:./node_modules/.bin
which browserify > /dev/null || (echo "can not find browserify" && false) || exit
+# prepare / update testing environment if needed
+JASMINE_VER=3.2.1
+JASMINE_LIB="test/lib/jasmine-$JASMINE_VER"
+if ! [ -d "$JASMINE_LIB" ]; then
+ mkdir -p test/lib
+ rm -rf test/lib/jasmine-*
+ JASMINE_URL="https://github.com/jasmine/jasmine/releases/download/v$JASMINE_VER/jasmine-standalone-$JASMINE_VER.zip"
+ curl -L -o "$JASMINE_LIB.zip" "$JASMINE_URL" && unzip -d test/ $JASMINE_LIB.zip lib/**
+ rm -f "$JASMINE_LIB.zip"
+fi
# Build the main file
browserify main_background.js -o bundle.js
@@ -9,7 +19,10 @@ browserify main_background.js -o bundle.js
mkdir ./build_temp
# Move source files to temp directory
-cp -r icons ./build_temp
+if [ "$1" == "-t" -o "$1" == "--test" ]; then
+ cp -r ./test ./build_temp
+fi
+cp -r ./icons ./build_temp
cp -r ./html ./build_temp
cp -r ./content ./build_temp
cp -r ./common ./build_temp