@karmaniverous/get-dotenv 5.0.0-1 → 5.0.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -498,7 +498,8 @@ const cmdCommand$1 = new commander.Command()
498
498
  .description('execute command, conflicts with --command option (default subcommand)')
499
499
  .enablePositionalOptions()
500
500
  .passThroughOptions()
501
- .action(async (_options, thisCommand) => {
501
+ .argument('[command...]')
502
+ .action(async (commandParts, _options, thisCommand) => {
502
503
  if (!thisCommand.parent)
503
504
  throw new Error(`unable to resolve parent command`);
504
505
  if (!thisCommand.parent.parent)
@@ -511,7 +512,12 @@ const cmdCommand$1 = new commander.Command()
511
512
  const pkgCwd = !!raw.pkgCwd;
512
513
  const rootPath = typeof raw.rootPath === 'string' ? raw.rootPath : './';
513
514
  // Execute command.
514
- const command = thisCommand.args.join(' ');
515
+ const args = Array.isArray(commandParts) ? commandParts : [];
516
+ // When no positional tokens are provided (e.g., option form `-c/--command`),
517
+ // the preSubcommand hook handles execution. Avoid a duplicate call here.
518
+ if (args.length === 0)
519
+ return;
520
+ const command = args.map(String).join(' ');
515
521
  await execShellCommandBatch({
516
522
  command: resolveCommand(getDotenvCliOptions.scripts, command),
517
523
  getDotenvCliOptions,
@@ -578,8 +584,9 @@ const cmdCommand = new commander.Command()
578
584
  .configureHelp({ showGlobalOptions: true })
579
585
  .enablePositionalOptions()
580
586
  .passThroughOptions()
581
- .action(async (_options, thisCommand) => {
582
- const args = thisCommand.args;
587
+ .argument('[command...]')
588
+ .action(async (commandParts, _options, thisCommand) => {
589
+ const args = Array.isArray(commandParts) ? commandParts : [];
583
590
  if (args.length === 0)
584
591
  return;
585
592
  if (!thisCommand.parent)
package/dist/index.mjs CHANGED
@@ -495,7 +495,8 @@ const cmdCommand$1 = new Command()
495
495
  .description('execute command, conflicts with --command option (default subcommand)')
496
496
  .enablePositionalOptions()
497
497
  .passThroughOptions()
498
- .action(async (_options, thisCommand) => {
498
+ .argument('[command...]')
499
+ .action(async (commandParts, _options, thisCommand) => {
499
500
  if (!thisCommand.parent)
500
501
  throw new Error(`unable to resolve parent command`);
501
502
  if (!thisCommand.parent.parent)
@@ -508,7 +509,12 @@ const cmdCommand$1 = new Command()
508
509
  const pkgCwd = !!raw.pkgCwd;
509
510
  const rootPath = typeof raw.rootPath === 'string' ? raw.rootPath : './';
510
511
  // Execute command.
511
- const command = thisCommand.args.join(' ');
512
+ const args = Array.isArray(commandParts) ? commandParts : [];
513
+ // When no positional tokens are provided (e.g., option form `-c/--command`),
514
+ // the preSubcommand hook handles execution. Avoid a duplicate call here.
515
+ if (args.length === 0)
516
+ return;
517
+ const command = args.map(String).join(' ');
512
518
  await execShellCommandBatch({
513
519
  command: resolveCommand(getDotenvCliOptions.scripts, command),
514
520
  getDotenvCliOptions,
@@ -575,8 +581,9 @@ const cmdCommand = new Command()
575
581
  .configureHelp({ showGlobalOptions: true })
576
582
  .enablePositionalOptions()
577
583
  .passThroughOptions()
578
- .action(async (_options, thisCommand) => {
579
- const args = thisCommand.args;
584
+ .argument('[command...]')
585
+ .action(async (commandParts, _options, thisCommand) => {
586
+ const args = Array.isArray(commandParts) ? commandParts : [];
580
587
  if (args.length === 0)
581
588
  return;
582
589
  if (!thisCommand.parent)
package/package.json CHANGED
@@ -224,5 +224,5 @@
224
224
  },
225
225
  "type": "module",
226
226
  "types": "dist/index.d.ts",
227
- "version": "5.0.0-1"
227
+ "version": "5.0.0-2"
228
228
  }