This repository was archived by the owner on Aug 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·47 lines (38 loc) · 1.33 KB
/
Copy pathindex.js
File metadata and controls
executable file
·47 lines (38 loc) · 1.33 KB
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
#!/usr/bin/env node
'use strict';
const program = require('commander');
const functions = require('./program.functions.js');
const VerEx = require('verbal-expressions');
program
.version('0.0.1')
.command('project <name>')
.description('Scaffold a new Meteor project')
.action((name) => {
if (typeof name != 'string') return console.log('Name must be a string');
return functions.newProject(name)
});
program
.command('g:method <name>')
.description('Create a new method')
.action((name) => {
if (typeof name != 'string') return console.log('Name must be a string');
return functions.newMethod(name)
});
program
.command('g:api <name>')
.description('Create a new API with methods and tests')
.option('-T, --no-tests', 'don\'t include a test file')
.action((name) => {
if (typeof name != 'string') return console.log('Name must be a string');
return functions.newAPI(name)
});
program
.command('g:ui <type>')
.description('Create a new UI element')
.option('--no-sass', 'don\'t generate the SASS file for this component')
.action((type, options) => {
const typeCheck = VerEx().find('component').or('layout').or('page');
if (!typeCheck.test(type)) return console.log('UI type not recognized');
return functions.newUI(type, options);
});
program.parse(process.argv);