@mintlify/cli 4.0.628 → 4.0.630

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
@@ -151,3 +151,17 @@ export const terminate = (code) => __awaiter(void 0, void 0, void 0, function* (
151
151
  process.exit(code);
152
152
  });
153
153
  export const execAsync = promisify(exec);
154
+ export const detectPackageManager = (_a) => __awaiter(void 0, [_a], void 0, function* ({ packageName }) {
155
+ try {
156
+ const { stdout: packagePath } = yield execAsync(`which ${packageName}`);
157
+ if (packagePath.includes('pnpm')) {
158
+ return 'pnpm';
159
+ }
160
+ else {
161
+ return 'npm';
162
+ }
163
+ }
164
+ catch (error) {
165
+ return 'npm';
166
+ }
167
+ });
package/bin/index.js CHANGED
@@ -8,13 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var _a, _b;
11
+ var _a, _b, _c;
12
12
  import { spawn } from 'child_process';
13
13
  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 = (_b = (_a = process.argv[1]) === null || _a === void 0 ? void 0 : _a.split('/').pop()) !== null && _b !== void 0 ? _b : 'mint';
17
+ const packageName = ((_a = process.argv[1]) === null || _a === void 0 ? void 0 : _a.split('/').pop()) === 'index.js'
18
+ ? 'mint'
19
+ : (_c = (_b = process.argv[1]) === null || _b === void 0 ? void 0 : _b.split('/').pop()) !== null && _c !== void 0 ? _c : 'mint';
18
20
  let cli = null;
19
21
  let isShuttingDown = false;
20
22
  let hasExited = false;