Skip to content

Commit 6a32c22

Browse files
fendorhasufell
authored andcommitted
Don't delete the cache directory of ghcup
1 parent fd062c8 commit 6a32c22

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.github/workflows/test.yml

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ jobs:
3030
ghc-version: ${{ matrix.ghc }}
3131
- run: |
3232
mkdir -p test-workspace/bin/
33-
export GHCUP_USE_XDG_DIRS=1
34-
export XDG_BIN_HOME=$(pwd)/test-workspace/bin/.ghcup/bin
3533
export GHCUP_INSTALL_BASE_PREFIX=$(pwd)/test-workspace/bin
3634
echo $XDG_BIN_HOME $GHCUP_INSTALL_BASE_PREFIX
3735
ghcup --no-verbose prefetch hls 1.4.0

test/suite/extension.test.ts

+20-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ function getWorkspaceFile(name: string) {
3232
return wsroot.with({ path: path.posix.join(wsroot.path, name) });
3333
}
3434

35+
// function getWorkspaceGhcupCacheDirectory() {
36+
// const wsroot = getWorkspaceRoot().uri;
37+
// return wsroot.with({ path: path.posix.join(wsroot.path, 'bin/.ghcup/cache') });
38+
// }
39+
3540
async function deleteWorkspaceFiles(pred?: (fileType: [string, vscode.FileType]) => boolean) {
3641
await deleteFiles(getWorkspaceRoot().uri, pred);
3742
}
@@ -83,7 +88,21 @@ suite('Extension Test Suite', () => {
8388
vscode.window.showInformationMessage('Start all tests.');
8489

8590
suiteSetup(async () => {
86-
await deleteWorkspaceFiles(([fp, _]) => fp !== 'settings.json');
91+
await deleteWorkspaceFiles(([fp, type]) => {
92+
if (type === vscode.FileType.Directory && fp === '.vscode') {
93+
return false;
94+
}
95+
if (type === vscode.FileType.Directory && fp === 'bin') {
96+
return false;
97+
}
98+
if (type === vscode.FileType.Directory && fp === '.ghcup') {
99+
return false;
100+
}
101+
if (type === vscode.FileType.Directory && fp === 'cache') {
102+
return false;
103+
}
104+
return true;
105+
});
87106
await getHaskellConfig().update('logFile', 'hls.log');
88107
await getHaskellConfig().update('trace.server', 'messages');
89108
await getHaskellConfig().update('releasesDownloadStoragePath', path.normalize(getWorkspaceFile('bin').fsPath));

0 commit comments

Comments
 (0)