Skip to content

Commit ab05ecb

Browse files
committed
Fix type issues in scripts/writeGitVersion.mjs
1 parent ad64605 commit ab05ecb

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
import path from 'path'
2-
import fs from 'fs'
3-
import { fileURLToPath } from 'node:url'
4-
5-
const __filename = fileURLToPath(import.meta.url)
6-
const __dirname = path.dirname(__filename)
1+
import * as path from 'node:path'
2+
import * as fs from 'node:fs'
73

84
const gitRev = process.argv[2]
95

10-
const packagePath = path.join(__dirname, '../package.json')
11-
const pkg = JSON.parse(fs.readFileSync(packagePath))
6+
const packagePath = path.join(import.meta.dirname, '../package.json')
7+
const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf-8'))
128

139
pkg.version = `${pkg.version}-${gitRev}`
1410
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2))

0 commit comments

Comments
 (0)