Skip to content

Commit

Permalink
Use yazl to create zip
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Mar 9, 2018
1 parent e46beec commit 96551f1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
11 changes: 6 additions & 5 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ for (let f of files) {
}

// Create zip.
const JSZip = require('./deps/jszip')
const zip = new JSZip()
const yazl = require('./deps/yazl')
const zip = new yazl.ZipFile()
const distname = `yode-${version}-${process.platform}-${target_arch}.zip`
const filename = process.platform == 'win32' ? 'yode.exe' : 'yode'
zip.file(filename, fs.readFileSync(`out/Release/${filename}`))
.generateNodeStream({streamFiles:true})
.pipe(fs.createWriteStream(`out/Release/${distname}`))
zip.addFile('node/LICENSE', 'LICENSE')
zip.addFile(`out/Release/${filename}`, filename)
zip.outputStream.pipe(fs.createWriteStream(`out/Release/${distname}`))
zip.end()
Loading

0 comments on commit 96551f1

Please sign in to comment.