Skip to content

Commit 9aac827

Browse files
committed
Allow to disable ghcup upgrade
1 parent 5e71ebc commit 9aac827

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@
189189
"default": true,
190190
"description": "Whether to also install/manage GHC when 'manageHLS' is set to 'GHCup'."
191191
},
192+
"haskell.upgradeGHCup": {
193+
"scope": "resource",
194+
"type": "boolean",
195+
"default": true,
196+
"description": "Whether to upgrade GHCup automatically when 'manageHLS' is set to 'GHCup'."
197+
},
192198
"haskell.checkProject": {
193199
"scope": "resource",
194200
"type": "boolean",

src/hlsBinaries.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,10 @@ export async function getGHCup(context: ExtensionContext, logger: Logger): Promi
437437

438438
if (manageHLS === 'GHCup') {
439439
logger.info(`found ghcup at ${localGHCup}`);
440-
const args = ['upgrade'];
441-
await callGHCup(context, logger, args, 'Upgrading ghcup', true);
440+
const upgrade = workspace.getConfiguration('haskell').get('upgradeGHCup') as boolean;
441+
if (upgrade) {
442+
await callGHCup(context, logger, ['upgrade'], 'Upgrading ghcup', true);
443+
}
442444
return localGHCup;
443445
} else {
444446
throw new Error(`Internal error: tried to call ghcup while haskell.manageHLS is set to ${manageHLS}. Aborting!`);

0 commit comments

Comments
 (0)