Skip to content

Commit

Permalink
Fix installation on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Mar 2, 2022
1 parent 6a32c22 commit cde83b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hlsBinaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export async function downloadHaskellLanguageServer(
wrapper = downloadedWrapper;
}

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

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

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

0 comments on commit cde83b8

Please sign in to comment.