Skip to content

Commit

Permalink
docker/install: Clean up toolDir in teardown
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vvoland committed Nov 8, 2024
1 parent 4980de3 commit 0b611e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/docker/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 0b611e6

Please sign in to comment.