evophp 1.0.0

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/installer.js +39 -0
  2. package/package.json +13 -0
package/installer.js ADDED
@@ -0,0 +1,39 @@
1
+ const { execSync } = require("child_process");
2
+ const path = require("path");
3
+ const fs = require("fs");
4
+
5
+ (async () => {
6
+ try {
7
+ const projectName = process.argv[2] || "evolution-project";
8
+
9
+ // Clone the repository
10
+ console.log("Cloning the Evolution repository...");
11
+ execSync(`git clone https://github.com/kinsokafor/evolution.git ${projectName}`, { stdio: "inherit" });
12
+
13
+ // Navigate to the project directory
14
+ const projectPath = path.join(process.cwd(), projectName);
15
+ process.chdir(projectPath);
16
+
17
+ // Run `node evolution`
18
+ console.log("Running node evolution...");
19
+ execSync("node evolution", { stdio: "inherit" });
20
+
21
+ // Run `composer install`
22
+ if (fs.existsSync("composer.json")) {
23
+ console.log("Installing Composer dependencies...");
24
+ execSync("composer install", { stdio: "inherit" });
25
+ } else {
26
+ console.log("Composer file not found, skipping Composer installation.");
27
+ }
28
+
29
+ // Run `npm install`
30
+ console.log("Installing NPM dependencies...");
31
+ execSync("npm install", { stdio: "inherit" });
32
+
33
+ console.log("Installation complete! Navigate to your project folder to get started:");
34
+ console.log(`cd ${projectName}`);
35
+ } catch (error) {
36
+ console.error("An error occurred during the installation process:", error.message);
37
+ process.exit(1);
38
+ }
39
+ })();
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "evophp",
3
+ "version": "1.0.0",
4
+ "description": "Installer for the Evolution PHP project",
5
+ "main": "installer.js",
6
+ "scripts": {
7
+ "start": "node installer.js"
8
+ },
9
+ "bin": {
10
+ "evolution-installer": "./installer.js"
11
+ },
12
+ "dependencies": {}
13
+ }