Explorar o código

refactor: run prepublishonly before packing

Ifedapo Olarewaju %!s(int64=6) %!d(string=hai) anos
pai
achega
d73d1141c0
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      bin/endtoend-build

+ 8 - 1
bin/endtoend-build

@@ -4,12 +4,19 @@ 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
 
-UPPY_VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]')
+npm run prepublishOnly
 # archive the uppy package
+echo "Creating archive for Uppy package"
 npm pack
+
+UPPY_VERSION=$(node -e 'console.log(require("./package.json").version)')
 # install from the archived uppy package
+echo "Installing Uppy from archived file uppy-${UPPY_VERSION}.tgz"
 npm install --prefix ./test/endtoend uppy-${UPPY_VERSION}.tgz
 
+# removing package-lock.json because we do not need it.
+rm ./test/endtoend/package-lock.json
+
 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