Skip to content

Commit ebf1fff

Browse files
committed
Fix cross-platform issue when copying examples
1 parent 236f3da commit ebf1fff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/node-addon-examples/scripts/cmake-projects.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { readdirSync, statSync } from "node:fs";
2-
import { join } from "node:path";
2+
import path from "node:path";
33

4-
export const EXAMPLES_DIR = new URL("../examples", import.meta.url).pathname;
4+
export const EXAMPLES_DIR = path.resolve(import.meta.dirname, "../examples");
55

66
export function findCMakeProjects(dir = EXAMPLES_DIR): string[] {
77
let results: string[] = [];
88
const files = readdirSync(dir);
99

1010
for (const file of files) {
11-
const fullPath = join(dir, file);
11+
const fullPath = path.join(dir, file);
1212
if (statSync(fullPath).isDirectory()) {
1313
results = results.concat(findCMakeProjects(fullPath));
1414
} else if (file === "CMakeLists.txt") {

0 commit comments

Comments
 (0)