create-prisma-php-app 1.6.51 → 1.6.53
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 +1 -4
- package/dist/prisma-php.js +8 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ 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";
|
|
10
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
10
|
const __dirname = path.dirname(__filename);
|
|
12
11
|
let updateAnswer = null;
|
|
@@ -351,7 +350,7 @@ async function getAnswer(predefinedAnswers = {}) {
|
|
|
351
350
|
console.log("🚀 ~ questions:", questions);
|
|
352
351
|
const onCancel = () => {
|
|
353
352
|
console.log(chalk.red("Operation cancelled by the user."));
|
|
354
|
-
process.exit(
|
|
353
|
+
process.exit(0);
|
|
355
354
|
};
|
|
356
355
|
try {
|
|
357
356
|
const response = await prompts(questions, { onCancel });
|
|
@@ -445,7 +444,6 @@ async function main() {
|
|
|
445
444
|
answer = await getAnswer(predefinedAnswers);
|
|
446
445
|
if (answer === null) {
|
|
447
446
|
console.log(chalk.red("Installation cancelled."));
|
|
448
|
-
exitCode;
|
|
449
447
|
return;
|
|
450
448
|
}
|
|
451
449
|
updateAnswer = {
|
|
@@ -461,7 +459,6 @@ async function main() {
|
|
|
461
459
|
}
|
|
462
460
|
if (answer === null) {
|
|
463
461
|
console.log(chalk.red("Installation cancelled."));
|
|
464
|
-
exitCode;
|
|
465
462
|
return;
|
|
466
463
|
}
|
|
467
464
|
// execSync(`npm install -g create-prisma-php-app`, { stdio: "inherit" }); // TODO: Uncomment this line before publishing the package
|
package/dist/prisma-php.js
CHANGED
|
@@ -34,14 +34,15 @@ async function getAnswer() {
|
|
|
34
34
|
{
|
|
35
35
|
type: "toggle",
|
|
36
36
|
name: "shouldProceed",
|
|
37
|
-
message: `This command will update the ${chalk.blue("create-prisma-php-app")} package and overwrite all default files. Do you want to proceed?`,
|
|
37
|
+
message: `This command will update the ${chalk.blue("create-prisma-php-app")} package and overwrite all default files. ${chalk.blue("Do you want to proceed")}?`,
|
|
38
38
|
initial: false,
|
|
39
39
|
active: "Yes",
|
|
40
40
|
inactive: "No",
|
|
41
41
|
},
|
|
42
42
|
];
|
|
43
43
|
const onCancel = () => {
|
|
44
|
-
|
|
44
|
+
console.log(chalk.red("Operation cancelled by the user."));
|
|
45
|
+
process.exit(0);
|
|
45
46
|
};
|
|
46
47
|
const response = await prompts(questions, { onCancel });
|
|
47
48
|
if (Object.keys(response).length === 0) {
|
|
@@ -54,11 +55,15 @@ const main = async () => {
|
|
|
54
55
|
try {
|
|
55
56
|
const answer = await getAnswer();
|
|
56
57
|
if (!(answer === null || answer === void 0 ? void 0 : answer.shouldProceed)) {
|
|
57
|
-
console.log("Operation cancelled by the user.");
|
|
58
|
+
console.log(chalk.red("Operation cancelled by the user."));
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
const currentDir = process.cwd();
|
|
61
62
|
const configPath = path.join(currentDir, "prisma-php.json");
|
|
63
|
+
if (!fs.existsSync(configPath)) {
|
|
64
|
+
console.error(chalk.red("The configuration file 'prisma-php.json' was not found in the current directory."));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
62
67
|
const localSettings = readJsonFile(configPath);
|
|
63
68
|
const commandArgs = [localSettings.projectName];
|
|
64
69
|
if (localSettings.tailwindcss)
|