forked from react-fullstack/slush-react-fullstack
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
39 lines (38 loc) · 1.31 KB
/
app.js
File metadata and controls
39 lines (38 loc) · 1.31 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
module.exports = function(_, conflict, gulp, inquirer, install, mkdirp, rename, template){
gulp.task('default', function (done) {
var prompts = [{
name: 'appName',
message: 'What would you like to call your application?',
default: 'React-Flux-Fullstack'
}, {
name: 'appDescription',
message: 'How would you describe your application?',
default: 'Full-Stack JavaScript with MongoDB, Express, React, Flux and Node.js'
}, {
name: 'appKeywords',
message: 'How would you describe your application in comma seperated key words?',
default: 'MongoDB, Express, React, Flux, Node.js'
}, {
name: 'appAuthor',
message: 'What is your company/author name?'
}];
//Ask
inquirer.prompt(prompts, function (answers) {
if (!answers.appName) {
return done();
}
answers.slugifiedAppName = _.slugify(answers.appName);
answers.humanizedAppName = _.humanize(answers.appName);
answers.capitalizedAppAuthor = _.capitalize(answers.appAuthor);
gulp.src(__dirname + '/../templates/app/**')
.pipe(template(answers, {interpolate: /<\?\?(.+?)\?>/g}))
.pipe(conflict('./'))
.pipe(gulp.dest('./'))
.pipe(install())
.on('end', function() {
done();
});
});
});
return gulp;
}