Skip to content

Commit 24607d1

Browse files
author
Marcus Pousette
committed
fix: bump
1 parent 2139df5 commit 24607d1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/node-entry.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as fs from 'fs';
22
import * as path from 'path';
3+
import { fileURLToPath } from 'url';
34

45
export interface InitNativeOptions {
56
database?: string;
@@ -35,9 +36,14 @@ function libExt(): string {
3536
return 'so';
3637
}
3738

39+
function packageRootDir(): string {
40+
// dist/node-entry.js -> package root
41+
const here = path.dirname(fileURLToPath(import.meta.url));
42+
return path.resolve(here, '..');
43+
}
44+
3845
function findLocalPrebuilt(): string | undefined {
39-
const root = process.cwd();
40-
const outDir = path.join(root, 'dist', 'native');
46+
const outDir = path.join(packageRootDir(), 'dist', 'native');
4147
if (!fs.existsSync(outDir)) return undefined;
4248
const ext = libExt();
4349
const triple = platformTriple();

0 commit comments

Comments
 (0)