Skip to content

Commit

Permalink
Fix .version lookup (close #28)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee committed Jan 7, 2021
1 parent 05fcfdc commit c1255e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/hyp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import subcommand from 'subcommand'
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'

import * as hyper from '../lib/hyper/index.js'

Expand Down Expand Up @@ -74,7 +76,7 @@ match(argv)
// error output when no/invalid command is given
function none (args) {
if (args.version) {
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'))
const packageJson = JSON.parse(fs.readFileSync(path.join(fileURLToPath(import.meta.url), '../../package.json'), 'utf8'))
console.log(packageJson.version)
process.exit(0)
}
Expand Down

0 comments on commit c1255e1

Please sign in to comment.