-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·50 lines (37 loc) · 1.13 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
50
#!/usr/bin/env node
"use strict";
var path = require("path");
var inquirer = require("inquirer");
// Prompt for initial action
var actionQuestion = {
name: "action",
type: "list",
message: "Please choose an action:",
choices: [
{ value: 1, name: "Start new Hudson-Taylor based project" }
// { value: 2, name: "Create a new Hudson-Taylor service" },
// { value: 3, name: "Generate documentation for existing service" }
]
};
inquirer.prompt([ actionQuestion ], function(answer) {
var action = answer.action;
switch(action) {
case 1: {
require(path.resolve(__dirname, "actions/new_project"));
break;
}
// case 2: {
// require(path.resolve(__dirname, "actions/new_service"));
// break;
// }
// case 3: {
// require(path.resolve(__dirname, "actions/gen_documentation"));
// break;
// }
default: {
// I don't think you can get here, anyway.
console.error("Invalid answer.");
process.exit(1);
}
}
});