Skip to content

Commit cde83b8

Browse files
committed
Fix installation on windows
1 parent 6a32c22 commit cde83b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hlsBinaries.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export async function downloadHaskellLanguageServer(
164164
wrapper = downloadedWrapper;
165165
}
166166

167-
const ghcup = path.join(storagePath, 'ghcup');
167+
const ghcup = path.join(storagePath, `ghcup${exeExt}`);
168168
const updateBehaviour = workspace.getConfiguration('haskell').get('updateBehavior') as UpdateBehaviour;
169169
const [installable_hls, latest_hls_version, project_ghc] = await getLatestSuitableHLS(
170170
context,
@@ -294,7 +294,7 @@ async function getLatestSuitableHLS(
294294
// TODO: we may run this function twice on startup (e.g. in extension.ts)
295295
const project_ghc =
296296
wrapper == undefined
297-
? await callAsync('ghc', ['--numeric-version'], storagePath, logger, undefined, false)
297+
? await callAsync(`ghc${exeExt}`, ['--numeric-version'], storagePath, logger, undefined, false)
298298
: await getProjectGHCVersion(wrapper, workingDir, logger);
299299

300300
// get installable HLS that supports the project GHC version (this might not be the most recent)
@@ -371,9 +371,9 @@ export async function downloadGHCup(context: ExtensionContext, logger: Logger):
371371
fs.mkdirSync(storagePath);
372372
}
373373

374-
const ghcup = path.join(storagePath, 'ghcup');
374+
const ghcup = path.join(storagePath, `ghcup${exeExt}`);
375375
// ghcup exists, just upgrade
376-
if (fs.existsSync(path.join(storagePath, 'ghcup'))) {
376+
if (fs.existsSync(ghcup)) {
377377
const args = ['--no-verbose', 'upgrade', '-i'];
378378
await callAsync(ghcup, args, storagePath, logger, undefined, false, { GHCUP_INSTALL_BASE_PREFIX: storagePath });
379379
} else {

0 commit comments

Comments
 (0)