-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
ยท49 lines (41 loc) ยท 1.35 KB
/
index.js
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
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env node
import path from "path";
import { getPrompts } from "./lib/prompts.js";
import { generateFiles } from "./lib/fileGenerator.js";
import { initializeGit } from "./lib/gitInitializer.js";
import { installPackages } from "./lib/packageInstaller.js";
async function main() {
console.log(`
๐ Yocode - Your VS Code Extension Generator ๐
Ready to bring your extension ideas to life!
`);
const answers = await getPrompts();
const targetDir = path.join(process.cwd(), answers.identifier);
// Step 1: Generate all necessary files and folders
await generateFiles(targetDir, answers);
// Step 2: Initialize Git, if requested
if (answers.gitInit) {
try {
await initializeGit(targetDir);
} catch (error) {
console.error("Failed to initialize Git repository:", error);
}
}
// Step 3: Install dependencies using the specified package manager
try {
await installPackages(targetDir, answers.packageManager);
} catch (error) {
console.error(
`Failed to install dependencies with ${answers.packageManager}:`,
error
);
}
// Final message after project setup is complete
console.log(
`๐ Congratulations! Your project has been set up successfully in ${targetDir} ๐`
);
console.log(
"๐ Time to start building your awesome extension! Happy coding! ๐"
);
}
main();