Skip to content

Commit

Permalink
fix: correctly parse arguments for list --is-pack (#194)
Browse files Browse the repository at this point in the history
build(deps): upgrade commander to ^5.0.0

Fixes #186.
  • Loading branch information
malept committed Mar 23, 2020
1 parent 1ece9c8 commit 3f243e2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions bin/asar.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ program.command('list <archive>')
for (var i in files) {
console.log(files[i])
}
// This is in order to disappear help
process.exit(0)
})

program.command('extract-file <archive> <filename>')
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"dependencies": {
"chromium-pickle-js": "^0.2.0",
"commander": "^4.1.1",
"commander": "^5.0.0",
"glob": "^7.1.6",
"minimatch": "^3.0.4"
},
Expand Down
6 changes: 3 additions & 3 deletions test/cli-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const compDirs = require('./util/compareDirectories')
const compFileLists = require('./util/compareFileLists')
const compFiles = require('./util/compareFiles')

childProcess.exec = promisify(childProcess.exec)
const exec = promisify(childProcess.exec)

async function execAsar (args) {
return childProcess.exec(`node bin/asar ${args}`)
return exec(`node bin/asar ${args}`)
}

async function assertAsarOutputMatches (args, expectedFilename) {
Expand Down Expand Up @@ -118,7 +118,7 @@ describe('command line interface', function () {
return assertAsarOutputMatches('l test/expected/packthis-unpack-dir.asar', 'test/expected/extractthis-filelist.txt')
})
it('should list files/dirs in archive with unpacked dirs & is-pack option', async () => {
return assertAsarOutputMatches('l test/expected/packthis-unpack-dir.asar --is-pack', 'test/expected/extractthis-filelist-with-option.txt')
return assertAsarOutputMatches('l --is-pack test/expected/packthis-unpack-dir.asar', 'test/expected/extractthis-filelist-with-option.txt')
})
it('should extract an archive with unpacked dirs', async () => {
await execAsar('e test/input/extractthis-unpack-dir.asar tmp/extractthis-unpack-dir/')
Expand Down

0 comments on commit 3f243e2

Please sign in to comment.