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 55f5d9f commit 13e464eCopy full SHA for 13e464e
packages/packemon/src/helpers/getVersion.ts
@@ -1,6 +1,10 @@
1
+import path from 'node:path';
2
+import { fileURLToPath } from 'node:url';
3
import { PackageStructure } from '@boost/common';
4
import { FileSystem } from '../FileSystem';
5
6
+const PKG_PATH = path.join(path.dirname(fileURLToPath(import.meta.url)), '../../package.json');
7
+
8
export function getVersion(fs: FileSystem): string {
- return fs.readJson<PackageStructure>(new URL('../../package.json', import.meta.url).href).version;
9
+ return fs.readJson<PackageStructure>(PKG_PATH).version;
10
}
0 commit comments