소스 검색

refactor: run prepublishonly before packing

Ifedapo Olarewaju 6 년 전
부모
커밋
d73d1141c0
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  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