Skip to content

Commit

Permalink
fix: use yargs handler
Browse files Browse the repository at this point in the history
  • Loading branch information
edumudu committed Mar 16, 2022
1 parent c43d336 commit 07636d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ if(!fs.existsSync(packageDir)) fs.mkdirSync(packageDir);
if(!fs.existsSync(modulesRoot)) fs.mkdirSync(modulesRoot);

yargs(hideBin(process.argv))
.command('publish', 'Publish a package to the local registry', (yargsInstance) => publish(yargsInstance.parse()))
.command('install', 'Install a package from the local registry', (yargsInstance) => install(yargsInstance.parse()._[1]))
.command('publish', 'Publish a package to the local registry', {}, () => publish())
.command('install <packageName>', 'Install a package from the local registry', {}, (argv) => install(argv.packageName))
.demandCommand(1, chalk.red('You need to specify a command'))
.strict()
.help()
Expand Down

0 comments on commit 07636d7

Please sign in to comment.