generator-aspnetcore-spa now displays its own version number on startup

This commit is contained in:
SteveSandersonMS
2016-12-08 15:16:26 +00:00
parent 67c2cfd84e
commit 62b676174e

View File

@@ -9,6 +9,7 @@ import npmWhich = require('npm-which');
const yosay = require('yosay'); const yosay = require('yosay');
const toPascalCase = require('to-pascal-case'); const toPascalCase = require('to-pascal-case');
const isWindows = /^win/.test(process.platform); const isWindows = /^win/.test(process.platform);
const generatorPackageJson = require(path.resolve(__dirname, '../package.json'));
// Paths matching these regexes will only be included if the user wants tests // Paths matching these regexes will only be included if the user wants tests
const testSpecificPaths = [ const testSpecificPaths = [
@@ -48,7 +49,7 @@ class MyGenerator extends yeoman.Base {
constructor(args: string | string[], options: any) { constructor(args: string | string[], options: any) {
super(args, options); super(args, options);
this._optionOrPrompt = optionOrPrompt; this._optionOrPrompt = optionOrPrompt;
this.log(yosay('Welcome to the ASP.NET Core Single-Page App generator!')); this.log(yosay('Welcome to the ASP.NET Core Single-Page App generator!\n\nVersion: ' + generatorPackageJson.version));
if (isWindows) { if (isWindows) {
assertNpmVersionIsAtLeast('3.0.0'); assertNpmVersionIsAtLeast('3.0.0');