Fix executable path when testing if ormolu is installed
commit56b0114b55566c2a5375081bd5e15ae750f17a50
authorFelix Leitz <felix.leitz92@gmail.com>
dateWed 16 Mar 2022, 17:21 (5 years ago)
parent51a44ed
src/extension.ts+3−3
@@ -15,14 +15,14 @@ export function activate(context: vscode.ExtensionContext) {
1515 return [];
1616 };
1717
18+ const cfg = vscode.workspace.getConfiguration("ormolu");
19+
1820 try {
19− proc.execSync('ormolu --help');
21+ proc.execSync(cfg.executablePath + ' --help');
2022 } catch (e) {
2123 return showErrorMessage("Ormolu is not installed", e);
2224 }
2325
24− const cfg = vscode.workspace.getConfiguration("ormolu");
25−
2626 let command = cfg.executablePath;
2727
2828 command += ` --start-line ${range.start.line + 1} --end-line ${range.end.line + (range.end.character == 0 ? 0 : 1)}`