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.
Files changed (2) hide show
  1. package/dist/prisma-php.js +11 -1
  2. package/package.json +1 -1
@@ -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=e=>{const r=fs.readFileSync(e,"utf8");return JSON.parse(r)},executeCommand=(e,r=[],o={})=>new Promise(((s,i)=>{const t=spawn(e,r,Object.assign({stdio:"inherit",shell:!0},o));t.on("error",(e=>{i(e)})),t.on("close",(e=>{0===e?s():i(new Error(`Process exited with code ${e}`))}))}));
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.6.23",
3
+ "version": "1.6.24",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",