Skip to content

Commit 3f243e2

Browse files
authored
fix: correctly parse arguments for list --is-pack (#194)
build(deps): upgrade commander to ^5.0.0 Fixes #186.
1 parent 1ece9c8 commit 3f243e2

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

bin/asar.js

-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ program.command('list <archive>')
5555
for (var i in files) {
5656
console.log(files[i])
5757
}
58-
// This is in order to disappear help
59-
process.exit(0)
6058
})
6159

6260
program.command('extract-file <archive> <filename>')

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"dependencies": {
4646
"chromium-pickle-js": "^0.2.0",
47-
"commander": "^4.1.1",
47+
"commander": "^5.0.0",
4848
"glob": "^7.1.6",
4949
"minimatch": "^3.0.4"
5050
},

test/cli-spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ const compDirs = require('./util/compareDirectories')
1212
const compFileLists = require('./util/compareFileLists')
1313
const compFiles = require('./util/compareFiles')
1414

15-
childProcess.exec = promisify(childProcess.exec)
15+
const exec = promisify(childProcess.exec)
1616

1717
async function execAsar (args) {
18-
return childProcess.exec(`node bin/asar ${args}`)
18+
return exec(`node bin/asar ${args}`)
1919
}
2020

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

0 commit comments

Comments
 (0)