Skip to content

Commit 25d1e29

Browse files
committed
fix: 确定根目录时进入死循环
1 parent 876423d commit 25d1e29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export function resolveRootDir() {
6363
if (configFiles.some((file) => fs.existsSync(path.join(dir, file)))) {
6464
return dir;
6565
}
66-
} while (dir);
66+
dir = path.dirname(dir);
67+
} while (path.parse(dir).base);
6768
throw new Error(
6869
"Unable to determine the project root directory, please add the package.json file to the project root directory"
6970
);

0 commit comments

Comments
 (0)