Skip to content

Commit 7be23bd

Browse files
committed
fix(gen): move some insight code
1 parent be7e71d commit 7be23bd

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

Diff for: app/generator.js

+9-11
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,21 @@ export default class Generator extends Base {
3939
genBase(this);
4040

4141
if(insight.optOut === undefined) {
42-
insight.askPermission(null, (err, optIn) => {
43-
if(err || !optIn) return cb();
44-
insight.track('generatorVersion', this.rootGeneratorVersion());
45-
insight.track('node', process.version);
46-
exec('npm --version', (err, stdin, stderr) => {
47-
if(err || stderr.length > 0) return insight.track('npm', 'error');
48-
else return insight.track('npm', stdin.toString().trim());
49-
});
50-
insight.track('platform', process.platform);
51-
return cb();
52-
});
42+
insight.askPermission(null, cb);
5343
} else {
5444
return cb();
5545
}
5646
},
5747

5848
info: function () {
49+
insight.track('generator', this.rootGeneratorVersion());
50+
insight.track('node', process.version);
51+
exec('npm --version', (err, stdin, stderr) => {
52+
if(err || stderr.length > 0) return insight.track('npm', 'error');
53+
else return insight.track('npm', stdin.toString().trim());
54+
});
55+
insight.track('platform', process.platform);
56+
5957
this.log(this.yoWelcome);
6058
this.log('Out of the box I create an AngularJS app with an Express server.\n');
6159
},

0 commit comments

Comments
 (0)