-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.js
More file actions
executable file
·37 lines (27 loc) · 1.03 KB
/
setup.js
File metadata and controls
executable file
·37 lines (27 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env node
import { execSync } from "child_process";
import path from "path"
import fs from "fs"
const projectName = process.argv[2] || "my-app";
// Step 1: Clone the repository
console.log(`Cloning the project into ${projectName}...`);
execSync(`git clone https://github.com/Zaiidmo/vlpha-react-app.git ${projectName}`, { stdio: "inherit" });
// Step 2: Navigate into the project directory
process.chdir(projectName);
// Step 3: Remove the .git folder
console.log("Removing the original .git folder...");
fs.rmSync(path.join(process.cwd(), ".git"), { recursive: true, force: true });
// Step 4: Initialize a new git repository (optional)
console.log("Initializing a new git repository...");
execSync("git init", { stdio: "inherit" });
// Step 5: Install dependencies
console.log("Installing dependencies...");
execSync("npm install", { stdio: "inherit" });
// Final message
console.log(`
Setup complete!
Your project is ready in the ${projectName} directory.
To start the development server:
cd ${projectName}
npm run dev
`);