Skip to content

Commit

Permalink
Workaround yargs bug with --version
Browse files Browse the repository at this point in the history
Fixes #405
  • Loading branch information
RyanZim committed Sep 30, 2021
1 parent 66b7c80 commit 2e64c9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/args.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import yargs from 'yargs'
import fs from 'fs-extra'

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

0 comments on commit 2e64c9c

Please sign in to comment.