From 9442a75f9dd06a16d6dc9e4c9f044ab00a130b1b Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Wed, 27 Sep 2017 08:18:44 -0700 Subject: [PATCH] add windows binary-zip Using 7-Zip --- appveyor.yml | 1 + scripts/binary/zip.coffee | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index a9795380aa..1a6099417e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,6 +26,7 @@ test_script: - 7z - cd packages/launcher && node index.js && cd ../.. - npm run binary-build -- --platform windows --version 0.20.2-win + - npm run binary-zip # - cd packages/server && npm run test-unit # - npm test diff --git a/scripts/binary/zip.coffee b/scripts/binary/zip.coffee index 97c3b2293f..e5aa57951d 100644 --- a/scripts/binary/zip.coffee +++ b/scripts/binary/zip.coffee @@ -68,9 +68,31 @@ linuxZip = (src, dest) -> .then R.tap(checkZipSize) .catch onError +# resolves with zipped filename +windowsZip = (src, dest) -> + # use 7Zip to zip + # http://www.7-zip.org/ + cmd = "7z a #{dest} #{src}#{path.sep}*" + console.log("windows zip: #{cmd}") + + onZipFinished = () -> + console.log("✅ zip finished") + + onError = (err) -> + console.error("⛔️ could not zip #{src} into #{dest}") + console.error(err.message) + throw err + + execa.shell(cmd) + .then onZipFinished + .then R.always(dest) + .then R.tap(checkZipSize) + .catch onError + zippers = { linux: linuxZip darwin: macZip + win32: windowsZip } module.exports = {