Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function zip() {
console.log('Compressing build...')
process.chdir(buildPath)
const def = new Deferred()
const sevenProcess = Seven.add(filePath, '*', {
recursive: true
})
sevenProcess.on('error', (err) => {
def.reject(err)
})
sevenProcess.on('end', (info) => {
def.resolve()
})
return def.promise
}
export const compress7z = async (files, archive, options) => {
options = {
...options,
$bin: pathTo7zip,
}
try {
await fs.remove(archive)
} catch (e) {
console.error(e.stack)
}
await Seven.add(archive, files, options)
}