Skip to content

Commit 5fc96b7

Browse files
committed
fix: package lookup
1 parent f930bb9 commit 5fc96b7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ import { execSync } from 'node:child_process';
22
import { Spec } from '@vltpkg/spec';
33
import { manifest as getManifest } from '@vltpkg/package-info';
44
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
5-
import { join } from 'node:path';
5+
import { join, dirname } from 'node:path';
66
import { homedir } from 'node:os';
7-
const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
7+
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'));
812

913
interface PackageManifest {
1014
name: string

0 commit comments

Comments
 (0)