-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (35 loc) · 1.21 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
#!/usr/bin/env node
const fs = require('fs');
const CURR_DIR = process.cwd();
const inquirer = require('inquirer');
// app
const projectGenQuestions = require('./app/config/project-gen-questions.const');
// AngularJS
const {buildAngularjsProject} = require("./app/modules/angularjs/index");
// Angular
const {buildAngularProject} = require('./app/modules/angular/index');
var Func = {
promptTogetProject: function () {
fs.mkdirSync(`${CURR_DIR}/dist`);
inquirer.prompt(projectGenQuestions)
.then(answers => {
const projectChoice = answers['project-choice'];
const projectName = answers['project-name'];
const templatePath = `${__dirname}/templates/${projectChoice}`;
switch (projectChoice) {
case "angularjs":
buildAngularjsProject(projectName, templatePath);
break;
case "angular":
buildAngularProject(projectName, templatePath);
break;
default:
break;
}
});
}
};
var init = function () {
Func.promptTogetProject();
};
init();