Skip to content

Commit 3c16882

Browse files
committed
adjust prod path to binary
1 parent bf1084e commit 3c16882

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

client/src/commands/code_analysis.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,16 @@ let analysisDevPath = path.join(
133133
"analysis",
134134
"rescript-editor-analysis.exe"
135135
);
136+
136137
let analysisProdPath = path.join(
137138
path.dirname(__dirname),
139+
"server",
138140
"analysis_binaries",
139141
process.platform,
140142
"rescript-editor-analysis.exe"
141143
);
142144

143-
let getBinaryPath = () : string | null => {
145+
let getBinaryPath = (): string | null => {
144146
if (fs.existsSync(analysisDevPath)) {
145147
return analysisDevPath;
146148
} else if (fs.existsSync(analysisProdPath)) {
@@ -160,11 +162,11 @@ export const runCodeAnalysisWithReanalyze = (
160162

161163
let binaryPath = getBinaryPath();
162164
if (binaryPath === null) {
163-
window.showErrorMessage("Binary executable not found.", analysisDevPath);
165+
window.showErrorMessage("Binary executable not found.", analysisProdPath);
164166
return;
165167
}
166168

167-
let p = cp.spawn(analysisDevPath, ["reanalyze", "-json"], {
169+
let p = cp.spawn(binaryPath, ["reanalyze", "-json"], {
168170
cwd,
169171
});
170172

0 commit comments

Comments
 (0)