@karmaniverous/get-dotenv 4.2.0 → 4.2.1

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.
@@ -34117,14 +34117,14 @@ const globPaths = async ({ globs, logger, pkgCwd, rootPath, }) => {
34117
34117
  cwd = pkgDir;
34118
34118
  }
34119
34119
  const absRootPath = require$$0$1.posix.join(cwd.split(require$$0$1.sep).join(require$$0$1.posix.sep), rootPath.split(require$$0$1.sep).join(require$$0$1.posix.sep));
34120
- const paths = await globby(globs, {
34120
+ const paths = await globby(globs.split(/\s+/), {
34121
34121
  cwd: absRootPath,
34122
34122
  expandDirectories: false,
34123
34123
  onlyDirectories: true,
34124
34124
  absolute: true,
34125
34125
  });
34126
34126
  if (!paths.length) {
34127
- logger.error(`No paths found for globs '${globs.toString()}' at '${absRootPath}'.`);
34127
+ logger.error(`No paths found for globs '${globs}' at '${absRootPath}'.`);
34128
34128
  process.exit(0);
34129
34129
  }
34130
34130
  return { absRootPath, paths };
@@ -34145,7 +34145,7 @@ const execShellCommandBatch = async ({ command, globs, ignoreErrors, list, logge
34145
34145
  : 'Executing shell command batch...';
34146
34146
  logger.info('');
34147
34147
  const headerRootPath = `ROOT: ${absRootPath}`;
34148
- const headerGlobs = `GLOBS: ${globs.toString()}`;
34148
+ const headerGlobs = `GLOBS: ${globs}`;
34149
34149
  const headerCommand = `CMD: ${command}`;
34150
34150
  logger.info('*'.repeat(Math.max(headerTitle.length, headerRootPath.length, headerGlobs.length, headerCommand.length)));
34151
34151
  logger.info(headerTitle);
@@ -34216,7 +34216,7 @@ const batchCommand = new Command()
34216
34216
  .passThroughOptions()
34217
34217
  .option('-p, --pkg-cwd', 'use nearest package directory as current working directory')
34218
34218
  .option('-r, --root-path <string>', 'path to batch root directory from current working directory', './')
34219
- .option('-g, --globs <strings...>', 'space-delimited globs from root path', '*')
34219
+ .option('-g, --globs <string>', 'space-delimited globs from root path', '*')
34220
34220
  .option('-c, --command <string>', 'shell command string, conflicts with cmd subcommand (dotenv-expanded)', dotenvExpandFromProcessEnv)
34221
34221
  .option('-l, --list', 'list working directories without executing command')
34222
34222
  .option('-e, --ignore-errors', 'ignore errors and continue with next path')
@@ -34250,13 +34250,15 @@ const cmdCommand = new Command()
34250
34250
  .enablePositionalOptions()
34251
34251
  .passThroughOptions()
34252
34252
  .action(async (options, thisCommand) => {
34253
+ if (thisCommand.args.length === 0)
34254
+ return;
34253
34255
  if (!thisCommand.parent)
34254
34256
  throw new Error('parent command not found');
34255
34257
  const { getDotenvOptions: { debug, logger = console, shellScripts }, } = thisCommand.parent;
34256
34258
  const command = thisCommand.args.join(' ');
34257
34259
  const shellCommand = shellScripts?.[command] ?? command;
34258
34260
  if (debug)
34259
- logger.log('\n*** shell command ***\n', shellCommand);
34261
+ logger.log('\n*** shell command ***\n', `'${shellCommand}'`);
34260
34262
  await execaCommand(shellCommand, {
34261
34263
  shell: true,
34262
34264
  stdio: 'inherit',
package/dist/index.cjs CHANGED
@@ -34119,14 +34119,14 @@ const globPaths = async ({ globs, logger, pkgCwd, rootPath, }) => {
34119
34119
  cwd = pkgDir;
34120
34120
  }
34121
34121
  const absRootPath = require$$0$1.posix.join(cwd.split(require$$0$1.sep).join(require$$0$1.posix.sep), rootPath.split(require$$0$1.sep).join(require$$0$1.posix.sep));
34122
- const paths = await globby(globs, {
34122
+ const paths = await globby(globs.split(/\s+/), {
34123
34123
  cwd: absRootPath,
34124
34124
  expandDirectories: false,
34125
34125
  onlyDirectories: true,
34126
34126
  absolute: true,
34127
34127
  });
34128
34128
  if (!paths.length) {
34129
- logger.error(`No paths found for globs '${globs.toString()}' at '${absRootPath}'.`);
34129
+ logger.error(`No paths found for globs '${globs}' at '${absRootPath}'.`);
34130
34130
  process.exit(0);
34131
34131
  }
34132
34132
  return { absRootPath, paths };
@@ -34147,7 +34147,7 @@ const execShellCommandBatch = async ({ command, globs, ignoreErrors, list, logge
34147
34147
  : 'Executing shell command batch...';
34148
34148
  logger.info('');
34149
34149
  const headerRootPath = `ROOT: ${absRootPath}`;
34150
- const headerGlobs = `GLOBS: ${globs.toString()}`;
34150
+ const headerGlobs = `GLOBS: ${globs}`;
34151
34151
  const headerCommand = `CMD: ${command}`;
34152
34152
  logger.info('*'.repeat(Math.max(headerTitle.length, headerRootPath.length, headerGlobs.length, headerCommand.length)));
34153
34153
  logger.info(headerTitle);
@@ -34218,7 +34218,7 @@ const batchCommand = new Command()
34218
34218
  .passThroughOptions()
34219
34219
  .option('-p, --pkg-cwd', 'use nearest package directory as current working directory')
34220
34220
  .option('-r, --root-path <string>', 'path to batch root directory from current working directory', './')
34221
- .option('-g, --globs <strings...>', 'space-delimited globs from root path', '*')
34221
+ .option('-g, --globs <string>', 'space-delimited globs from root path', '*')
34222
34222
  .option('-c, --command <string>', 'shell command string, conflicts with cmd subcommand (dotenv-expanded)', dotenvExpandFromProcessEnv)
34223
34223
  .option('-l, --list', 'list working directories without executing command')
34224
34224
  .option('-e, --ignore-errors', 'ignore errors and continue with next path')
@@ -34252,13 +34252,15 @@ const cmdCommand = new Command()
34252
34252
  .enablePositionalOptions()
34253
34253
  .passThroughOptions()
34254
34254
  .action(async (options, thisCommand) => {
34255
+ if (thisCommand.args.length === 0)
34256
+ return;
34255
34257
  if (!thisCommand.parent)
34256
34258
  throw new Error('parent command not found');
34257
34259
  const { getDotenvOptions: { debug, logger = console, shellScripts }, } = thisCommand.parent;
34258
34260
  const command = thisCommand.args.join(' ');
34259
34261
  const shellCommand = shellScripts?.[command] ?? command;
34260
34262
  if (debug)
34261
- logger.log('\n*** shell command ***\n', shellCommand);
34263
+ logger.log('\n*** shell command ***\n', `'${shellCommand}'`);
34262
34264
  await execaCommand(shellCommand, {
34263
34265
  shell: true,
34264
34266
  stdio: 'inherit',
package/dist/index.mjs CHANGED
@@ -34116,14 +34116,14 @@ const globPaths = async ({ globs, logger, pkgCwd, rootPath, }) => {
34116
34116
  cwd = pkgDir;
34117
34117
  }
34118
34118
  const absRootPath = require$$0$1.posix.join(cwd.split(require$$0$1.sep).join(require$$0$1.posix.sep), rootPath.split(require$$0$1.sep).join(require$$0$1.posix.sep));
34119
- const paths = await globby(globs, {
34119
+ const paths = await globby(globs.split(/\s+/), {
34120
34120
  cwd: absRootPath,
34121
34121
  expandDirectories: false,
34122
34122
  onlyDirectories: true,
34123
34123
  absolute: true,
34124
34124
  });
34125
34125
  if (!paths.length) {
34126
- logger.error(`No paths found for globs '${globs.toString()}' at '${absRootPath}'.`);
34126
+ logger.error(`No paths found for globs '${globs}' at '${absRootPath}'.`);
34127
34127
  process.exit(0);
34128
34128
  }
34129
34129
  return { absRootPath, paths };
@@ -34144,7 +34144,7 @@ const execShellCommandBatch = async ({ command, globs, ignoreErrors, list, logge
34144
34144
  : 'Executing shell command batch...';
34145
34145
  logger.info('');
34146
34146
  const headerRootPath = `ROOT: ${absRootPath}`;
34147
- const headerGlobs = `GLOBS: ${globs.toString()}`;
34147
+ const headerGlobs = `GLOBS: ${globs}`;
34148
34148
  const headerCommand = `CMD: ${command}`;
34149
34149
  logger.info('*'.repeat(Math.max(headerTitle.length, headerRootPath.length, headerGlobs.length, headerCommand.length)));
34150
34150
  logger.info(headerTitle);
@@ -34215,7 +34215,7 @@ const batchCommand = new Command()
34215
34215
  .passThroughOptions()
34216
34216
  .option('-p, --pkg-cwd', 'use nearest package directory as current working directory')
34217
34217
  .option('-r, --root-path <string>', 'path to batch root directory from current working directory', './')
34218
- .option('-g, --globs <strings...>', 'space-delimited globs from root path', '*')
34218
+ .option('-g, --globs <string>', 'space-delimited globs from root path', '*')
34219
34219
  .option('-c, --command <string>', 'shell command string, conflicts with cmd subcommand (dotenv-expanded)', dotenvExpandFromProcessEnv)
34220
34220
  .option('-l, --list', 'list working directories without executing command')
34221
34221
  .option('-e, --ignore-errors', 'ignore errors and continue with next path')
@@ -34249,13 +34249,15 @@ const cmdCommand = new Command()
34249
34249
  .enablePositionalOptions()
34250
34250
  .passThroughOptions()
34251
34251
  .action(async (options, thisCommand) => {
34252
+ if (thisCommand.args.length === 0)
34253
+ return;
34252
34254
  if (!thisCommand.parent)
34253
34255
  throw new Error('parent command not found');
34254
34256
  const { getDotenvOptions: { debug, logger = console, shellScripts }, } = thisCommand.parent;
34255
34257
  const command = thisCommand.args.join(' ');
34256
34258
  const shellCommand = shellScripts?.[command] ?? command;
34257
34259
  if (debug)
34258
- logger.log('\n*** shell command ***\n', shellCommand);
34260
+ logger.log('\n*** shell command ***\n', `'${shellCommand}'`);
34259
34261
  await execaCommand(shellCommand, {
34260
34262
  shell: true,
34261
34263
  stdio: 'inherit',
package/package.json CHANGED
@@ -131,5 +131,5 @@
131
131
  },
132
132
  "type": "module",
133
133
  "types": "dist/index.d.ts",
134
- "version": "4.2.0"
134
+ "version": "4.2.1"
135
135
  }