@mintlify/cli 4.0.649 → 4.0.651

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/bin/helpers.js CHANGED
@@ -97,6 +97,9 @@ export const getCliVersion = () => {
97
97
  version = s;
98
98
  return false;
99
99
  });
100
+ if (process.env.CLI_TEST_MODE === 'true') {
101
+ return 'test-cli';
102
+ }
100
103
  // when running `npm link` the version is 'unknown'
101
104
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
102
105
  if (version === 'unknown') {
package/bin/index.js CHANGED
@@ -14,9 +14,9 @@ import path from 'path';
14
14
  import { fileURLToPath } from 'url';
15
15
  const __filename = fileURLToPath(import.meta.url);
16
16
  const __dirname = path.dirname(__filename);
17
- const packageName = ((_a = process.argv[1]) === null || _a === void 0 ? void 0 : _a.split('/').pop()) === 'index.js'
17
+ const packageName = path.basename((_a = process.argv[1]) !== null && _a !== void 0 ? _a : '') === 'index.js'
18
18
  ? 'mint'
19
- : (_c = (_b = process.argv[1]) === null || _b === void 0 ? void 0 : _b.split('/').pop()) !== null && _c !== void 0 ? _c : 'mint';
19
+ : path.basename((_b = process.argv[1]) !== null && _b !== void 0 ? _b : '') || 'mint';
20
20
  let cli = null;
21
21
  let isShuttingDown = false;
22
22
  let hasExited = false;
@@ -69,7 +69,7 @@ process.on('unhandledRejection', () => __awaiter(void 0, void 0, void 0, functio
69
69
  try {
70
70
  cli = spawn('node', ['--no-deprecation', path.join(__dirname, '../bin/start.js'), ...process.argv.slice(2)], {
71
71
  stdio: 'inherit',
72
- env: Object.assign(Object.assign({}, process.env), { MINTLIFY_PACKAGE_NAME: packageName }),
72
+ env: Object.assign(Object.assign({}, process.env), { MINTLIFY_PACKAGE_NAME: packageName, CLI_TEST_MODE: (_c = process.env.CLI_TEST_MODE) !== null && _c !== void 0 ? _c : 'false' }),
73
73
  shell: process.platform === 'win32',
74
74
  windowsHide: process.platform === 'win32',
75
75
  detached: false,