create-prisma-php-app 1.23.4 → 1.23.6

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/index.js +7 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -166,9 +166,13 @@ async function main() {
166
166
  "app",
167
167
  "swagger-docs"
168
168
  );
169
- // Check if the directory exists, if not, create it
170
- if (!fs.existsSync(swaggerDocsPath)) {
171
- fs.mkdirSync(swaggerDocsPath, { recursive: true }); // 'recursive: true' creates parent directories if they don't exist
169
+ // Check if the directory exists
170
+ if (fs.existsSync(swaggerDocsPath)) {
171
+ // If it exists and is not empty, remove it before cloning
172
+ if (fs.readdirSync(swaggerDocsPath).length > 0) {
173
+ console.log("Removing existing swagger-docs directory...");
174
+ fs.rmSync(swaggerDocsPath, { recursive: true, force: true });
175
+ }
172
176
  }
173
177
  // Clone the Git repository into the swagger-docs directory
174
178
  execSync(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.23.4",
3
+ "version": "1.23.6",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",