Skip to content

Commit

Permalink
use npm run scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdwheatley committed Nov 21, 2015
1 parent 4806243 commit 5c0aeca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
27 changes: 8 additions & 19 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var yeoman = require('yeoman-generator'),
chalk = require('chalk'),
npmCheck = require('npm-check'),
path = require('path'),
yosay = require('yosay'),
l = require('lodash');
Expand Down Expand Up @@ -58,25 +57,15 @@ module.exports = yeoman.generators.Base.extend({
});

this.on('dependenciesInstalled', function () {
npmCheck({
global: true
}).then(function (globalPackages) {
if (!globalPackages.gulp) {
return './node_modules/.bin/gulp';
}
return 'gulp';
}).then(function (gulpCommand) {
this.spawnCommand(gulpCommand).on('close', function () {
this.log('');
this.log('');
this.log('Setup complete, run ' +
chalk.bold.yellow(gulpCommand + ' dev') +
' to start serving the application' +
' (it\'ll also start watching for any changes you make).');
this.log('');
}.bind(this));
this.spawnCommand('./node_modules/.bin/gulp').on('close', function () {
this.log('');
this.log('');
this.log('Setup complete, run ' +
chalk.bold.yellow('npm start') +
' to start serving the application' +
' (it\'ll also start watching for any changes you make).');
this.log('');
}.bind(this));

}.bind(this));

}
Expand Down
4 changes: 4 additions & 0 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "<%= appname %>",
"version": "0.0.0",
"scripts": {
"build": "gulp",
"start": "gulp dev"
},
"dependencies": {
"angular2": "2.0.0-alpha.36",
"reflect-metadata": "0.1.1",
Expand Down

0 comments on commit 5c0aeca

Please sign in to comment.