|
@@ -1,23 +1,26 @@
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
-echo "Preparing for end to end test: copying static HTML and CSS, building JS"
|
|
|
-rm -rf ./test/endtoend/dist && mkdir ./test/endtoend/dist
|
|
|
-rm -rf ./test/endtoend/node_modules
|
|
|
+set -o pipefail
|
|
|
+set -o errexit
|
|
|
+set -o nounset
|
|
|
+set -o xtrace
|
|
|
|
|
|
-npm run prepublishOnly
|
|
|
-# archive the uppy package
|
|
|
-echo "Creating archive for Uppy package"
|
|
|
-cd packages/uppy && npm pack && cd ../..
|
|
|
+# Set magic variables for current file & dir
|
|
|
+__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
+__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
|
|
|
+__base="$(basename ${__file} .sh)"
|
|
|
+__root="$(cd "$(dirname "${__dir}")" && pwd)"
|
|
|
|
|
|
-UPPY_VERSION=$(node -e 'console.log(require("./packages/uppy/package.json").version)')
|
|
|
-# install from the archived uppy package
|
|
|
-echo "Installing Uppy from archived file uppy-${UPPY_VERSION}.tgz"
|
|
|
-npm install --prefix ./test/endtoend packages/uppy/uppy-${UPPY_VERSION}.tgz
|
|
|
+echo "Preparing for end to end test: copying static HTML and CSS, building JS"
|
|
|
+rm -rf "${__root}/test/endtoend/dist" && mkdir "${__root}/test/endtoend/dist"
|
|
|
+rm -rf "${__root}/test/endtoend/node_modules"
|
|
|
|
|
|
-# removing package-lock.json because we do not need it.
|
|
|
-rm ./test/endtoend/package-lock.json
|
|
|
+npm run build
|
|
|
|
|
|
-cp ./test/endtoend/node_modules/uppy/dist/uppy.min.css ./test/endtoend/dist
|
|
|
-cp ./test/endtoend/src/index.html ./test/endtoend/dist
|
|
|
-browserify ./test/endtoend/src/main.js -o ./test/endtoend/dist/bundle.js -t babelify
|
|
|
-rm -rf ./test/endtoend/node_modules
|
|
|
+cp "${__root}/packages/uppy/dist/uppy.min.css" "${__root}/test/endtoend/dist"
|
|
|
+cp "${__root}/test/endtoend/src/index.html" "${__root}/test/endtoend/dist"
|
|
|
+browserify "${__root}/test/endtoend/src/main.js" \
|
|
|
+ -o "${__root}/test/endtoend/dist/bundle.js" \
|
|
|
+ -t babelify \
|
|
|
+ -t aliasify
|
|
|
+rm -rf "${__root}/test/endtoend/node_modules"
|