Skip to content

Commit

Permalink
fix(gen): move some insight code
Browse files Browse the repository at this point in the history
  • Loading branch information
Awk34 committed Mar 12, 2016
1 parent be7e71d commit 7be23bd
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions app/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,21 @@ export default class Generator extends Base {
genBase(this);

if(insight.optOut === undefined) {
insight.askPermission(null, (err, optIn) => {
if(err || !optIn) return cb();
insight.track('generatorVersion', this.rootGeneratorVersion());
insight.track('node', process.version);
exec('npm --version', (err, stdin, stderr) => {
if(err || stderr.length > 0) return insight.track('npm', 'error');
else return insight.track('npm', stdin.toString().trim());
});
insight.track('platform', process.platform);
return cb();
});
insight.askPermission(null, cb);
} else {
return cb();
}
},

info: function () {
insight.track('generator', this.rootGeneratorVersion());
insight.track('node', process.version);
exec('npm --version', (err, stdin, stderr) => {
if(err || stderr.length > 0) return insight.track('npm', 'error');
else return insight.track('npm', stdin.toString().trim());
});
insight.track('platform', process.platform);

this.log(this.yoWelcome);
this.log('Out of the box I create an AngularJS app with an Express server.\n');
},
Expand Down

0 comments on commit 7be23bd

Please sign in to comment.