create-prisma-php-app 1.6.23 → 1.6.24
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/prisma-php.js +11 -1
- package/package.json +1 -1
package/dist/prisma-php.js
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{spawn}from"child_process";import fs from"fs";import path from"path";import{fileURLToPath}from"url";const __filename=fileURLToPath(import.meta.url),__dirname=path.dirname(__filename),args=process.argv.slice(2),readJsonFile=
|
|
2
|
+
import{spawn}from"child_process";import fs from"fs";import path from"path";import prompts from"prompts";import{fileURLToPath}from"url";const __filename=fileURLToPath(import.meta.url),__dirname=path.dirname(__filename),args=process.argv.slice(2),readJsonFile=r=>{const e=fs.readFileSync(r,"utf8");return JSON.parse(e)},executeCommand=(r,e=[],o={})=>new Promise(((s,t)=>{const i=spawn(r,e,Object.assign({stdio:"inherit",shell:!0},o));i.on("error",(r=>{t(r)})),i.on("close",(r=>{0===r?s():t(new Error(`Process exited with code ${r}`))}))}));
|
|
3
3
|
const main = async () => {
|
|
4
4
|
if (args.length > 0 && args[0] === "update") {
|
|
5
5
|
try {
|
|
6
|
+
const shouldProceed = await prompts({
|
|
7
|
+
type: "confirm",
|
|
8
|
+
name: "value",
|
|
9
|
+
message: "This will overwrite existing files and directories. Do you want to continue?",
|
|
10
|
+
initial: false,
|
|
11
|
+
});
|
|
12
|
+
if (!shouldProceed.value) {
|
|
13
|
+
console.log("Operation cancelled by the user.");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
6
16
|
const currentDir = process.cwd();
|
|
7
17
|
const configPath = path.join(currentDir, "prisma-php.json");
|
|
8
18
|
const localSettings = readJsonFile(configPath);
|