create-prisma-php-app 1.11.527 → 1.11.529
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 +40 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -227,13 +227,28 @@ function copyRecursiveSync(src, dest, answer) {
|
|
|
227
227
|
(dest.includes("tailwind.css") || dest.includes("styles.css"))
|
|
228
228
|
)
|
|
229
229
|
return;
|
|
230
|
+
if (
|
|
231
|
+
!answer.websocket &&
|
|
232
|
+
(dest.includes("restart-websocket.cjs") ||
|
|
233
|
+
dest.includes("restart-websocket.bat"))
|
|
234
|
+
)
|
|
235
|
+
return;
|
|
230
236
|
fs.copyFileSync(src, dest, 0);
|
|
231
237
|
}
|
|
232
238
|
}
|
|
233
239
|
// Function to execute the recursive copy for entire directories
|
|
234
240
|
async function executeCopy(baseDir, directoriesToCopy, answer) {
|
|
235
241
|
directoriesToCopy.forEach(({ srcDir, destDir }) => {
|
|
236
|
-
if (
|
|
242
|
+
if (
|
|
243
|
+
!answer.prisma &&
|
|
244
|
+
(srcDir === "/prisma-client-php" || srcDir === "\\prisma-client-php")
|
|
245
|
+
)
|
|
246
|
+
return;
|
|
247
|
+
if (
|
|
248
|
+
!answer.websocket &&
|
|
249
|
+
(srcDir === "/src/Lib/Websocket" || srcDir === "\\src\\Lib\\Websocket")
|
|
250
|
+
)
|
|
251
|
+
return;
|
|
237
252
|
const sourcePath = path.join(__dirname, srcDir);
|
|
238
253
|
const destPath = path.join(baseDir, destDir);
|
|
239
254
|
copyRecursiveSync(sourcePath, destPath, answer);
|
|
@@ -696,29 +711,29 @@ async function main() {
|
|
|
696
711
|
// });
|
|
697
712
|
// }
|
|
698
713
|
// Update websocket if not chosen by the user
|
|
699
|
-
if (!answer.websocket) {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}
|
|
714
|
+
// if (!answer.websocket) {
|
|
715
|
+
// const wsPath = path.join(projectPath, "src", "Lib", "Websocket");
|
|
716
|
+
// // Check if the websocket directory exists
|
|
717
|
+
// if (fs.existsSync(wsPath)) {
|
|
718
|
+
// // Use fs.rmSync with recursive option set to true to delete the directory and its contents
|
|
719
|
+
// fs.rmSync(wsPath, { recursive: true, force: true }); // force option is not necessary but can be used to ensure deletion
|
|
720
|
+
// console.log("Websocket directory was deleted successfully.");
|
|
721
|
+
// } else {
|
|
722
|
+
// console.log("Websocket directory does not exist.");
|
|
723
|
+
// }
|
|
724
|
+
// // Update settings directory if websocket is not chosen
|
|
725
|
+
// const settingsPath = path.join(projectPath, "settings");
|
|
726
|
+
// const websocketFiles = ["restart-websocket.cjs", "restart-websocket.bat"];
|
|
727
|
+
// websocketFiles.forEach((file) => {
|
|
728
|
+
// const filePath = path.join(settingsPath, file);
|
|
729
|
+
// if (fs.existsSync(filePath)) {
|
|
730
|
+
// fs.unlinkSync(filePath); // Delete each file if it exists
|
|
731
|
+
// console.log(`${file} was deleted successfully.`);
|
|
732
|
+
// } else {
|
|
733
|
+
// console.log(`${file} does not exist.`);
|
|
734
|
+
// }
|
|
735
|
+
// });
|
|
736
|
+
// }
|
|
722
737
|
if (!answer.prisma) {
|
|
723
738
|
const prismaPath = path.join(projectPath, "prisma");
|
|
724
739
|
const prismClassPath = path.join(projectPath, "src", "Lib", "Prisma");
|
|
@@ -816,11 +831,8 @@ async function main() {
|
|
|
816
831
|
JSON.stringify(prismaPhpConfig, null, 2),
|
|
817
832
|
{ flag: "w" }
|
|
818
833
|
);
|
|
819
|
-
execSync(`php C:\\ProgramData\\ComposerSetup\\bin\\composer.phar install`, {
|
|
820
|
-
stdio: "inherit",
|
|
821
|
-
});
|
|
822
834
|
execSync(
|
|
823
|
-
`php C:\\ProgramData\\ComposerSetup\\bin\\composer.phar
|
|
835
|
+
`D:\\xampp\\php\\php.exe C:\\ProgramData\\ComposerSetup\\bin\\composer.phar install`,
|
|
824
836
|
{
|
|
825
837
|
stdio: "inherit",
|
|
826
838
|
}
|