forked from GodLesZ/gulpsetup
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ahoi.js
81 lines (68 loc) · 2.08 KB
/
ahoi.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env node
"use strict";
var inquirer = require("inquirer");
var program = require('commander');
var poster = require('./utils/poster')
var spawn = require('child_process').spawn;
var generator = require('./lib/generator');
var developer = require('./lib/developer');
var runner = require('./lib/runner');
var questioner = require('./lib/questioner');
var commanderOptions = function(){
program
.version('0.0.1')
.option('-d, --develop', 'Start Development Envoriment')
.option('-b, --build', 'build App')
.option('-n, --new', 'create new App')
.option('-s, --start', 'start App')
.option('-g, --generator', 'choose + run a generator')
.option('-u, --update', 'update a generator')
.parse(process.argv);
//////////////////////////////////////////////////////
// TODOS
if (program.develop) developer.init();
if (program.build) console.log(' - build');
if (program.new) console.log(' - new');
if (program.start) console.log(' - start');
if (program.generator) generator.init( program.args[0] )
if (program.update) console.log("Udpate: TBD")
if(!program.rawArgs[2] && !program.args.length ) poster.ahoi( widget );
}
var widget = function(){
console.log("##################### HOWDY, COMMANDS #################################")
program.outputHelp();
console.log("### # #### ## ### # ## ### ### ## #### #### ####### #### ##### ####")
var _choices = [
"Start Development",
"Bower",
"Build App",
new inquirer.Separator(),
"Setup new App",
"Quit",
];
inquirer.prompt([
{
type: "list",
name: "choice",
message: "What do you want to do?",
choices: _choices
}
], function( answers ) {
switch (answers.choice) {
case 'Setup new App':
console.log('list available Generators')
break;
case 'Quit':
break;
case 'Start Development':
developer.init( );
break;
case 'Bower':
questioner.bower();
break;
default:
//console.log('default')
}
});
}
commanderOptions();