Skip to content

Commit

Permalink
fix(cli): Prevent commander parsing from overriding git-annex-remote-…
Browse files Browse the repository at this point in the history
…openneuro
  • Loading branch information
nellh committed Nov 8, 2023
1 parent 0095eb6 commit bc9d855
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions packages/openneuro-cli/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ commander
.option('-s, --snapshot [snapshotVersion]')
.action(ls)

commander.parse(process.argv)

if (process.argv[1].endsWith('git-credential-openneuro')) {
gitCredential()
} else if (process.argv[1].endsWith('git-annex-remote-openneuro')) {
gitAnnexRemote()
} else if (!process.argv.slice(2).length) {
commander.help()
function main(argv) {
if (argv.endsWith('git-credential-openneuro')) {
gitCredential()
} else if (argv.endsWith('git-annex-remote-openneuro')) {
gitAnnexRemote()
} else if (!process.argv.slice(2).length) {
commander.help()
} else {
commander.parse(process.argv)
}
}

main(process.argv)

0 comments on commit bc9d855

Please sign in to comment.