@@ -164,7 +164,7 @@ export async function downloadHaskellLanguageServer(
164
164
wrapper = downloadedWrapper ;
165
165
}
166
166
167
- const ghcup = path . join ( storagePath , ' ghcup' ) ;
167
+ const ghcup = path . join ( storagePath , ` ghcup${ exeExt } ` ) ;
168
168
const updateBehaviour = workspace . getConfiguration ( 'haskell' ) . get ( 'updateBehavior' ) as UpdateBehaviour ;
169
169
const [ installable_hls , latest_hls_version , project_ghc ] = await getLatestSuitableHLS (
170
170
context ,
@@ -276,7 +276,7 @@ async function getLatestSuitableHLS(
276
276
wrapper ?: string
277
277
) : Promise < [ string , string , string | null ] > {
278
278
const storagePath : string = await getStoragePath ( context ) ;
279
- const ghcup = path . join ( storagePath , ' ghcup' ) ;
279
+ const ghcup = path . join ( storagePath , ` ghcup${ exeExt } ` ) ;
280
280
281
281
// get latest hls version
282
282
const hls_versions = await callAsync (
@@ -294,7 +294,7 @@ async function getLatestSuitableHLS(
294
294
// TODO: we may run this function twice on startup (e.g. in extension.ts)
295
295
const project_ghc =
296
296
wrapper == undefined
297
- ? await callAsync ( ' ghc' , [ '--numeric-version' ] , storagePath , logger , undefined , false )
297
+ ? await callAsync ( ` ghc${ exeExt } ` , [ '--numeric-version' ] , storagePath , logger , undefined , false )
298
298
: await getProjectGHCVersion ( wrapper , workingDir , logger ) ;
299
299
300
300
// 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):
371
371
fs . mkdirSync ( storagePath ) ;
372
372
}
373
373
374
- const ghcup = path . join ( storagePath , ' ghcup' ) ;
374
+ const ghcup = path . join ( storagePath , ` ghcup${ exeExt } ` ) ;
375
375
// ghcup exists, just upgrade
376
- if ( fs . existsSync ( path . join ( storagePath , ' ghcup' ) ) ) {
376
+ if ( fs . existsSync ( ghcup ) ) {
377
377
const args = [ '--no-verbose' , 'upgrade' , '-i' ] ;
378
378
await callAsync ( ghcup , args , storagePath , logger , undefined , false , { GHCUP_INSTALL_BASE_PREFIX : storagePath } ) ;
379
379
} else {
@@ -398,8 +398,8 @@ export async function downloadGHCup(context: ExtensionContext, logger: Logger):
398
398
window . showErrorMessage ( `Couldn't find any pre-built ghcup binary for ${ process . arch } ` ) ;
399
399
return null ;
400
400
}
401
- const title = 'Downloading ghcup' ;
402
401
const dlUri = `https://downloads.haskell.org/~ghcup/${ arch } -${ plat } -ghcup${ exeExt } ` ;
402
+ const title = `Downloading ${ dlUri } ` ;
403
403
const downloaded = await downloadFile ( title , dlUri , ghcup ) ;
404
404
if ( ! downloaded ) {
405
405
window . showErrorMessage ( `Couldn't download ${ dlUri } as ${ ghcup } ` ) ;
0 commit comments