on master help sign in
Fix executable path when testing if ormolu is installed
56b0114Felix Leitz
src/extension.ts+3−3
@@ -15,14 +15,14 @@ export function activate(context: vscode.ExtensionContext) {
15 return [];
15 return [];
16 };
16 };
17
17
18+ const cfg = vscode.workspace.getConfiguration("ormolu");
19+
18 try {
20 try {
19− proc.execSync('ormolu --help');
21+ proc.execSync(cfg.executablePath + ' --help');
20 } catch (e) {
22 } catch (e) {
21 return showErrorMessage("Ormolu is not installed", e);
23 return showErrorMessage("Ormolu is not installed", e);
22 }
24 }
23
25
24− const cfg = vscode.workspace.getConfiguration("ormolu");
25−
26 let command = cfg.executablePath;
26 let command = cfg.executablePath;
27
27
28 command += ` --start-line ${range.start.line + 1} --end-line ${range.end.line + (range.end.character == 0 ? 0 : 1)}`
28 command += ` --start-line ${range.start.line + 1} --end-line ${range.end.line + (range.end.character == 0 ? 0 : 1)}`