aboutsummaryrefslogtreecommitdiff
path: root/test/release/butternut.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/release/butternut.sh')
-rwxr-xr-xtest/release/butternut.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/release/butternut.sh b/test/release/butternut.sh
new file mode 100755
index 00000000..b62c9371
--- /dev/null
+++ b/test/release/butternut.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+alias uglify-js=$PWD/bin/uglifyjs
+UGLIFY_OPTIONS=$@
+
+minify_in_situ() {
+ DIRS="$1"
+ echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
+ for i in `find $DIRS -name '*.js'`
+ do
+ echo "$i"
+ uglify-js "$i" $UGLIFY_OPTIONS -o "$i"
+ done
+}
+
+rm -rf tmp/butternut \
+&& git clone https://github.com/Rich-Harris/butternut.git tmp/butternut \
+&& cd tmp/butternut \
+&& rm -rf .git/hooks \
+&& patch -l -p1 <<EOF
+--- a/package.json
++++ b/package.json
+@@ -25 +24,0 @@
+- "prepublish": "npm run test:min",
+--- a/rollup.config.js
++++ b/rollup.config.js
+@@ -1 +0,0 @@
+-import buble from 'rollup-plugin-buble';
+@@ -28,6 +26,0 @@ const config = {
+- buble({
+- include: ['src/**', 'node_modules/acorn/**'],
+- transforms: {
+- dangerousForOf: true
+- }
+- }),
+EOF
+ERR=$?; if [ "$ERR" != "0" ]; then echo "Error: $ERR"; exit $ERR; fi
+minify_in_situ "src" \
+&& rm -rf node_modules \
+&& npm install \
+&& rm -rf dist \
+&& npm run build \
+&& minify_in_situ "dist" \
+&& node_modules/.bin/mocha test/test.js