docker/install: Clean up toolDir in teardown

The `toolDir` is added to `PATH` on install, so make sure the binaries
aren't accessible after a teardown.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2024-11-08 17:00:09 +01:00
parent 4980de30fc
commit 0b611e6c46
No known key found for this signature in database
GPG Key ID: B85EFCFE26DEF92A

View File

@ -492,6 +492,13 @@ EOF`,
throw new Error(`Unsupported platform: ${os.platform()}`);
}
}
await core.group(`Cleaning up toolDir`, async () => {
if (!this._toolDir) {
return;
}
fs.rmSync(this._toolDir, {recursive: true, force: true});
});
}
private async tearDownDarwin(): Promise<void> {