3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-04-29 06:35:53 +00:00

Clean up credentials.toml

This commit is contained in:
Arpad Borsos 2023-08-02 12:54:48 +02:00
parent 5ec9842c14
commit 80c47cc945
No known key found for this signature in database
GPG key ID: FC7BCA77824B3298
3 changed files with 21 additions and 0 deletions

View file

@ -91,6 +91,13 @@ export async function cleanBin(oldBins: Array<string>) {
}
export async function cleanRegistry(packages: Packages, crates = true) {
// remove `.cargo/credentials.toml`
try {
const credentials = path.join(CARGO_HOME, ".cargo", "credentials.toml");
core.debug(`deleting "${credentials}"`);
await fs.promises.unlink(credentials);
} catch {}
// `.cargo/registry/index`
let pkgSet = new Set(packages.map((p) => p.name));
const indexDir = await fs.promises.opendir(path.join(CARGO_HOME, "registry", "index"));