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 236f3da commit ebf1fffCopy full SHA for ebf1fff
packages/node-addon-examples/scripts/cmake-projects.mts
@@ -1,14 +1,14 @@
1
import { readdirSync, statSync } from "node:fs";
2
-import { join } from "node:path";
+import path from "node:path";
3
4
-export const EXAMPLES_DIR = new URL("../examples", import.meta.url).pathname;
+export const EXAMPLES_DIR = path.resolve(import.meta.dirname, "../examples");
5
6
export function findCMakeProjects(dir = EXAMPLES_DIR): string[] {
7
let results: string[] = [];
8
const files = readdirSync(dir);
9
10
for (const file of files) {
11
- const fullPath = join(dir, file);
+ const fullPath = path.join(dir, file);
12
if (statSync(fullPath).isDirectory()) {
13
results = results.concat(findCMakeProjects(fullPath));
14
} else if (file === "CMakeLists.txt") {
0 commit comments