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 1
1
#!/usr/bin/env node
2
2
import { existsSync , readFileSync , writeFileSync } from 'node:fs'
3
- import { extname , join } from 'node:path'
3
+ import { extname } from 'node:path'
4
4
import { parseArgs } from 'node:util'
5
5
6
6
import chalk from 'chalk'
@@ -10,6 +10,7 @@ import { Adapter, Low } from 'lowdb'
10
10
import { DataFile , JSONFile } from 'lowdb/node'
11
11
import { PackageJson } from 'type-fest'
12
12
13
+ import { fileURLToPath } from 'node:url'
13
14
import { createApp } from './app.js'
14
15
import { Observer } from './observer.js'
15
16
import { Data } from './service.js'
@@ -70,7 +71,10 @@ function args(): {
70
71
// --version
71
72
if ( values . version ) {
72
73
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
+ ) ,
74
78
) as PackageJson
75
79
console . log ( pkg . version )
76
80
process . exit ( )
You can’t perform that action at this time.
0 commit comments