atcheck/lsscanner/new_ubuntu/node_modules/extract-zip/cli.js

21 lines
399 B
JavaScript
Raw Normal View History

2019-12-16 18:42:21 +01:00
#!/usr/bin/env node
var extract = require('./')
var args = process.argv.slice(2)
var source = args[0]
var dest = args[1] || process.cwd()
if (!source) {
console.error('Usage: extract-zip foo.zip <targetDirectory>')
process.exit(1)
}
extract(source, {dir: dest}, function (err, results) {
if (err) {
console.error('error!', err)
process.exit(1)
} else {
process.exit(0)
}
})