We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f930bb9 commit 5fc96b7Copy full SHA for 5fc96b7
index.ts
@@ -2,9 +2,13 @@ import { execSync } from 'node:child_process';
2
import { Spec } from '@vltpkg/spec';
3
import { manifest as getManifest } from '@vltpkg/package-info';
4
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
5
-import { join } from 'node:path';
+import { join, dirname } from 'node:path';
6
import { homedir } from 'node:os';
7
-const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
+import { fileURLToPath } from 'node:url';
8
+
9
+const __filename = fileURLToPath(import.meta.url);
10
+const __dirname = dirname(__filename);
11
+const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8'));
12
13
interface PackageManifest {
14
name: string
0 commit comments