Skip to content

Commit 2d46399

Browse files
committed
🩹 Don't use require in rootDirFinder
1 parent e0a4939 commit 2d46399

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

‎packages/tasks/src/scripts/inference-codegen.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ const rootDirFinder = function (): string {
1919
while (level > 0) {
2020
const currentPath = parts.slice(0, level).join("/");
2121
console.debug(currentPath);
22-
try {
23-
require(`${currentPath}/package.json`);
22+
if (pathExists(`${currentPath}/package.json`)) {
2423
return path.normalize(currentPath);
25-
} catch (err) {
26-
/// noop
2724
}
2825
level--;
2926
}

0 commit comments

Comments
 (0)