-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.js
executable file
·32 lines (28 loc) · 1 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
#!/usr/bin/env node
import { collectInfo } from "./src/templates/prompter.js";
import { createConfigFile } from "./src/utils/config.js";
import { createPackageJsonFile } from "./src/utils/npmDependencies.js";
import { createConfigurationFile } from "./src/utils/cypressSetup.js";
import { createGitIgnoreFile } from "./src/utils/ignore.js";
import { createPipelineFile } from "./src/utils/pipeline.js";
import { exec } from "child_process";
async function main() {
const answers = await collectInfo();
await createConfigFile(answers);
await createGitIgnoreFile(answers);
await createPackageJsonFile(answers);
await createConfigurationFile(answers);
await createPipelineFile(answers);
if (answers.installDependencies) {
console.log("Running npm install...");
exec("npm install", (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.error(`stderr: ${stderr}`);
});
}
}
main();