Skip to content

Commit 58fc4cd

Browse files
fhammerschmidtcristianoc
authored andcommitted
Check for the existence of a rescript binary when looking up the binary path
1 parent 0167621 commit 58fc4cd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/src/utils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ export let findBinaryFromProjectRoot = (
4242
projectRootPath: p.DocumentUri // This must be a directory and not a file!
4343
): null | p.DocumentUri => {
4444
let dir = path.dirname(projectRootPath);
45-
let bscNativeReScriptPath = path.join(projectRootPath, c.nodeModulesBinDir);
45+
let bscNativeReScriptPath = path.join(
46+
projectRootPath,
47+
c.nodeModulesBinDir,
48+
c.bscBinName
49+
);
4650

4751
if (fs.existsSync(bscNativeReScriptPath)) {
48-
return bscNativeReScriptPath;
52+
return path.dirname(bscNativeReScriptPath);
4953
} else if (dir === projectRootPath) {
5054
// reached the top
5155
return null;

0 commit comments

Comments
 (0)