Skip to content

Commit 9d3f851

Browse files
committed
Grab version used for CLI from package.json
1 parent 35ed699 commit 9d3f851

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cli.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as chokidar from 'chokidar';
99
import * as program from 'commander';
1010
import * as http from 'http';
1111
import * as path from 'path';
12+
const npmPackage = require('../../package.json');
1213

1314
import { runProxy } from './app';
1415

@@ -36,7 +37,7 @@ program //
3637
'watch for changes in a file or directory (falls back to the OpenAPI file) and restart server accordingly',
3738
)
3839
.option('-v, --verbose', 'show verbose output')
39-
.version('1.0.0')
40+
.version(npmPackage.version ?? '?')
4041
.parse(process.argv);
4142

4243
let server: http.Server;

0 commit comments

Comments
 (0)