-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
69 lines (65 loc) · 1.81 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* Created by mendieta on 7/27/16.
*/
var fs = require( "fs" );
var path = require( "path" );
var nyg = require( "nyg" );
var prompts = [
{
type : "input",
name : "repoName",
message: "Whats is the project name?",
default: "Foo-Project"
},
{
type : "input",
name : "author",
message: "Whats is your name? (Author)",
default: "Foo()"
},
{
type : "input",
name : "email",
message: "What is your email? (Author Email)",
default: "[email protected]"
},
{
type : "input",
name : "description",
message: "Describe the project",
default: "A Foo() project"
},
{
type : "list",
message: "What framework will your project use?",
name : "framework",
choices: [
{
name : "Vue",
value: "vue",
checked:true
},
{
name : "React",
value : "react"
}
]
}
];
var globs = [
{ base: "templates/{{framework}}" , template:false}
/*{ base: "templates/foo", output: "src/foo" },
{ base: "templates/assets", output: "src/assets" },
{ base: "templates/base" },
{ base: 'templates/unsupported/{{unsupported}}', output: 'static/' },
{ base: 'templates/unsupported/', glob: '*', output: 'static/' },
{ base: 'templates/unsupported/images/', output: 'static/img/unsupported/' }*/
]
var gen = nyg( prompts, globs )
.on( "postcopy", function () {
var done = gen.async();
/*fs.rename( path.join( gen.cwd, 'gitignore' ), path.join( gen.cwd, '.gitignore' ), function () {
gen.copy( 'templates/.babelrc', '.babelrc', done )
} )*/
} )
.run();