Skip to content

Commit 2decf8d

Browse files
committed
Use fs api to check if string is a directory.
1 parent 79992f1 commit 2decf8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export let findProjectRootOfFile = (
6767
if (foundRootFromProjectFiles != null) {
6868
return foundRootFromProjectFiles;
6969
} else {
70-
const isDir = path.extname(source) === "";
70+
const dirStat = fs.statSync(source);
71+
const isDir = dirStat.isDirectory();
7172
return findProjectRootOfFileInDir(
7273
isDir && !allowDir ? path.join(source, "dummy.res") : source
7374
);

0 commit comments

Comments
 (0)