From 9d3f85184bfcf1060d561ab1650991552851b49a Mon Sep 17 00:00:00 2001 From: LexLuengas Date: Fri, 28 Oct 2022 08:08:55 +0200 Subject: [PATCH] Grab version used for CLI from package.json --- src/cli.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli.ts b/src/cli.ts index 63a2a146..09049064 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -9,6 +9,7 @@ import * as chokidar from 'chokidar'; import * as program from 'commander'; import * as http from 'http'; import * as path from 'path'; +const npmPackage = require('../../package.json'); import { runProxy } from './app'; @@ -36,7 +37,7 @@ program // 'watch for changes in a file or directory (falls back to the OpenAPI file) and restart server accordingly', ) .option('-v, --verbose', 'show verbose output') - .version('1.0.0') + .version(npmPackage.version ?? '?') .parse(process.argv); let server: http.Server;