fix: print correct package version

This commit is contained in:
Spencer Elliott 2020-01-22 14:15:22 -05:00
parent f92f8b51ff
commit 1b39ca114b
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,8 @@ import { Command } from 'commander'
import { EnvCmdOptions } from './types'
import { parseArgList } from './utils'
import packageJson = require('../package.json');
/**
* Parses the arguments passed into the cli
*/
@ -55,7 +57,7 @@ export function parseArgs (args: string[]): EnvCmdOptions {
export function parseArgsUsingCommander (args: string[]): Command {
const program = new Command()
return program
.version('9.0.1', '-v, --version')
.version(packageJson.version, '-v, --version')
.usage('[options] <command> [...args]')
.option('-f, --file [path]', 'Custom env file path (default path: ./.env)')
.option('-r, --rc-file [path]', 'Custom rc file path (default path: ./.env-cmdrc(|.js|.json)')

View File

@ -7,7 +7,8 @@
"declaration": true,
"lib": [
"es2018"
]
],
"resolveJsonModule": true
},
"include": [
"./src/**/*"