Skip to content

Commit

Permalink
fix broken --version flag on global install
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwitt committed Dec 15, 2023
1 parent 76c7672 commit 2368f25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"scripts": {
"start": "./src/bin.js",
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest",
"test": "NODE_OPTIONS='--experimental-json-modules --experimental-vm-modules --no-warnings' jest",
"lint": "standard",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"standard": "standard",
Expand Down
2 changes: 1 addition & 1 deletion src/bin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env -S node --no-warnings
#!/usr/bin/env -S node --no-warnings --experimental-json-modules
import { run } from './cli.js'
await run(process.argv.slice(2))
7 changes: 4 additions & 3 deletions src/cli.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/**
* Command line interface implementation
*/
import { createReadStream, openSync, readFileSync } from 'node:fs'
import { createReadStream, openSync } from 'node:fs'
import { createInterface } from 'node:readline'
import { createRequire } from 'module'
import getUsage from 'command-line-usage'
import commandLineCommands from 'command-line-commands'
import commandLineArgs from 'command-line-args'
Expand All @@ -14,8 +15,8 @@ import { shutdownCache } from './cache.js'
import { withSentry } from './sentry.js'

const debug = Debug('qdone:cli')
const packageJson = JSON.parse(readFileSync('./package.json'))

const require = createRequire(import.meta.url)
const packageJson = require('../package.json')
class UsageError extends Error {}

const awsUsageHeader = { content: 'AWS SQS Authentication', raw: true, long: true }
Expand Down

0 comments on commit 2368f25

Please sign in to comment.