File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22import { existsSync , readFileSync , writeFileSync } from 'node:fs'
3- import { extname , join } from 'node:path'
3+ import { extname } from 'node:path'
44import { parseArgs } from 'node:util'
55
66import chalk from 'chalk'
@@ -10,6 +10,7 @@ import { Adapter, Low } from 'lowdb'
1010import { DataFile , JSONFile } from 'lowdb/node'
1111import { PackageJson } from 'type-fest'
1212
13+ import { fileURLToPath } from 'node:url'
1314import { createApp } from './app.js'
1415import { Observer } from './observer.js'
1516import { Data } from './service.js'
@@ -70,7 +71,10 @@ function args(): {
7071 // --version
7172 if ( values . version ) {
7273 const pkg = JSON . parse (
73- readFileSync ( join ( __dirname , '../package.json' ) , 'utf8' ) ,
74+ readFileSync (
75+ fileURLToPath ( new URL ( '../package.json' , import . meta. url ) ) ,
76+ 'utf-8' ,
77+ ) ,
7478 ) as PackageJson
7579 console . log ( pkg . version )
7680 process . exit ( )
You can’t perform that action at this time.
0 commit comments