var gulp = require('gulp'),
install = require('gulp-install'),
conflict = require('gulp-conflict'),
template = require('gulp-template'),
inquirer = require('inquirer');
gulp.task('default', function (done) {
inquirer.prompt([
{type: 'input', name: 'name', message: 'Give your app a name', default: gulp.args.join(' ')}, // Get app name from arguments by default
{type: 'confirm', name: 'moveon', message: 'Continue?'}
],
function (answers) {
if (!answers.moveon) {
return done();
}
gulp.src(__dirname + '/templates/app/**') // Note use of __dirname to be relative to generator
.pipe(template(answers)) // Lodash template support
.pipe(conflict('./')) // Confirms overwrites on file conflicts
.pipe(gulp.dest('./')) // Without __dirname here = relative to cwd
.pipe(install()) // Run `bower install` and/or `npm install` if necessary
.on('end', function () {
done(); // Finished!
});
});
});
I was wondering if you were open to making the slushfile here:
https://github.com/chrisenytc/slush-generator/blob/master/templates/slushfile.js
work like the example below:
which is found in the slush README.
https://github.com/klei/slush/blob/master/README.md
I would prefer that as I think it's cleaner, easier to understand, etc. What do you think? I would be willing to submit a pull request.