Skip to content

Commit

Permalink
add dirname to existing import of path
Browse files Browse the repository at this point in the history
  • Loading branch information
csmig committed Mar 28, 2024
1 parent 272ccb9 commit 7be405f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import help_default from './help.js'
help_default()
import { Command, Option, InvalidOptionArgumentError } from 'commander'
import { readFileSync } from 'node:fs'
import * as path from 'node:path'
import * as logger from './logger.js'
import { config } from 'dotenv'
import { resolve, sep, posix } from 'path'
import { dirname, resolve, sep, posix } from 'node:path'
import promptSync from 'prompt-sync'
import { createPrivateKey } from 'crypto'

Expand All @@ -15,7 +14,7 @@ const component = 'args'

function getVersion() {
try {
const packageJsonText = readFileSync(`${path.dirname(process?.pkg?.defaultEntrypoint ?? '.')}/package.json`, 'utf8')
const packageJsonText = readFileSync(`${dirname(process?.pkg?.defaultEntrypoint ?? '.')}/package.json`, 'utf8')
return JSON.parse(packageJsonText).version
}
catch (error) {
Expand Down

0 comments on commit 7be405f

Please sign in to comment.