From a370aa3783087d35db7c841479b93fd649e260a6 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 28 Dec 2017 14:25:17 +0200 Subject: Get version from package.json --- src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/index.ts b/src/index.ts index 2a2834b..e081fbc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ import * as program from 'commander'; import tag from './tag/tag'; import scss from './tag/scss'; import index from './tag/index'; +import * as pkg from '../package.json'; async function main(tagName: string) { const name = tagName.toLocaleLowerCase(); @@ -17,10 +18,13 @@ async function main(tagName: string) { }; program - .version('1.0.0') + .version(( pkg).version) .arguments('') .action(name => { main(name); }) + .action(() => { + console.log('No component name specified.'); + }) .usage('create-riot-component [name]') .parse(process.argv); \ No newline at end of file -- cgit v1.3