Skip to content

Commit 2e64c9c

Browse files
committed
Workaround yargs bug with --version
Fixes #405
1 parent 66b7c80 commit 2e64c9c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: lib/args.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import yargs from 'yargs'
2+
import fs from 'fs-extra'
23

34
const { argv } = yargs(process.argv.slice(2))
45
.usage(
@@ -94,6 +95,8 @@ const { argv } = yargs(process.argv.slice(2))
9495
type: 'string',
9596
})
9697
.alias('h', 'help')
98+
// HACK: Workaround for https://github.com/yargs/yargs/issues/1934
99+
.version(fs.readJSONSync(new URL('../package.json', import.meta.url).pathname).version)
97100
.example('$0 input.css -o output.css', 'Basic usage')
98101
.example('$0 src/**/*.css --base src --dir build', 'Glob Pattern & output')
99102
.example(

0 commit comments

Comments
 (0)