We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9df046 commit 9aae9cbCopy full SHA for 9aae9cb
lib/version-checker.ts
@@ -12,10 +12,12 @@ const __dirname = dirname(__filename)
12
13
/**
14
* Gets the local package version from package.json
15
+ * Note: In compiled output, this file is at dist/lib/version-checker.js
16
+ * so we need to go up two levels to reach package.json
17
*/
18
export function getLocalVersion(): string {
19
try {
- const pkgPath = join(__dirname, '../package.json')
20
+ const pkgPath = join(__dirname, '../../package.json')
21
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))
22
return pkg.version
23
} catch {
0 commit comments