add windows binary-zip

Using 7-Zip
This commit is contained in:
Gleb Bahmutov
2017-09-27 08:18:44 -07:00
parent 98a77c07d7
commit 9442a75f9d
2 changed files with 23 additions and 0 deletions

View File

@@ -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 = {