create-prisma-php-app 1.6.45 → 1.6.47
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.js +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import path from "path";
|
|
|
6
6
|
import chalk from "chalk";
|
|
7
7
|
import prompts from "prompts";
|
|
8
8
|
import https from "https";
|
|
9
|
+
import { exitCode } from "process";
|
|
9
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
11
|
const __dirname = path.dirname(__filename);
|
|
11
12
|
let updateAnswer = null;
|
|
@@ -356,6 +357,9 @@ async function getAnswer(predefinedAnswers = {}) {
|
|
|
356
357
|
if (Object.keys(response).length === 0 && !predefinedAnswers.projectName) {
|
|
357
358
|
return null;
|
|
358
359
|
}
|
|
360
|
+
if (onCancel()) {
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
359
363
|
return {
|
|
360
364
|
projectName: response.projectName
|
|
361
365
|
? String(response.projectName).trim().replace(/ /g, "-")
|
|
@@ -442,6 +446,7 @@ async function main() {
|
|
|
442
446
|
answer = await getAnswer(predefinedAnswers);
|
|
443
447
|
if (answer === null) {
|
|
444
448
|
console.log(chalk.red("Installation cancelled."));
|
|
449
|
+
exitCode;
|
|
445
450
|
return;
|
|
446
451
|
}
|
|
447
452
|
updateAnswer = {
|
|
@@ -457,6 +462,7 @@ async function main() {
|
|
|
457
462
|
}
|
|
458
463
|
if (answer === null) {
|
|
459
464
|
console.log(chalk.red("Installation cancelled."));
|
|
465
|
+
exitCode;
|
|
460
466
|
return;
|
|
461
467
|
}
|
|
462
468
|
// execSync(`npm install -g create-prisma-php-app`, { stdio: "inherit" }); // TODO: Uncomment this line before publishing the package
|