generator-node-tsnext
Advanced tools
Comparing version 1.5.0-beta.0 to 1.5.0-beta.1
@@ -8,32 +8,31 @@ const Generator = require('yeoman-generator'); | ||
initializing() { | ||
this.user.github.username().then(console.log).catch((e) => { | ||
console.log('haha', e); | ||
return []; | ||
}); | ||
try { | ||
const ghTask = this.user.github.username() | ||
.then(un => Promise.all([un, ghUser(un)])) | ||
.then(([un, info]) => { | ||
return [un, info.html_url]; | ||
}) | ||
.catch(() => []); | ||
const ghTask = this.user.github.username() | ||
.then(un => Promise.all([un, ghUser(un)])) | ||
.then(([un, info]) => { | ||
return [un, info.html_url]; | ||
}) | ||
.catch(() => []); | ||
return ghTask.then(([ username, homepage ]) => { | ||
console.log(this.user.git.email()); | ||
return ghTask.then(([ username, homepage ]) => { | ||
this.user.info = { | ||
name: this.user.git.name(), | ||
email: this.user.git.email(), | ||
username, | ||
homepage, | ||
}; | ||
}); | ||
} catch (_) { | ||
this.user.info = { | ||
name: this.user.git.name(), | ||
email: this.user.git.email(), | ||
username, | ||
homepage, | ||
name: this.user.git.name() || '', | ||
email: this.user.git.email() || '', | ||
username: '', | ||
homepage: '', | ||
}; | ||
}); | ||
} | ||
} | ||
prompting() { | ||
// Have Yeoman greet the user. | ||
this.log(yosay(`Welcome to the stunning ${chalk.red('generator-node-tsnext')}!`)); | ||
console.log(this.user.info); | ||
const fallbackDescription = | ||
@@ -40,0 +39,0 @@ 'Simple Node.js module to output greeting message, written in TypeScript'; |
{ | ||
"name": "generator-node-tsnext", | ||
"version": "1.5.0-beta.0", | ||
"version": "1.5.0-beta.1", | ||
"description": "Generator for developing in TypeScript Next", | ||
@@ -38,3 +38,3 @@ "keywords": [ | ||
"shx": "^0.3.2", | ||
"yeoman-assert": "^3.1.0", | ||
"yeoman-assert": "^3.1.1", | ||
"yeoman-test": "^2.0.0" | ||
@@ -41,0 +41,0 @@ }, |
162
22031