Skip to content

Commit bc9d855

Browse files
committed
fix(cli): Prevent commander parsing from overriding git-annex-remote-openneuro
1 parent 0095eb6 commit bc9d855

File tree

1 file changed

+12
-8
lines changed
  • packages/openneuro-cli/src

1 file changed

+12
-8
lines changed

packages/openneuro-cli/src/cli.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ commander
7474
.option('-s, --snapshot [snapshotVersion]')
7575
.action(ls)
7676

77-
commander.parse(process.argv)
78-
79-
if (process.argv[1].endsWith('git-credential-openneuro')) {
80-
gitCredential()
81-
} else if (process.argv[1].endsWith('git-annex-remote-openneuro')) {
82-
gitAnnexRemote()
83-
} else if (!process.argv.slice(2).length) {
84-
commander.help()
77+
function main(argv) {
78+
if (argv.endsWith('git-credential-openneuro')) {
79+
gitCredential()
80+
} else if (argv.endsWith('git-annex-remote-openneuro')) {
81+
gitAnnexRemote()
82+
} else if (!process.argv.slice(2).length) {
83+
commander.help()
84+
} else {
85+
commander.parse(process.argv)
86+
}
8587
}
88+
89+
main(process.argv)

0 commit comments

Comments
 (0)