mirror of
https://github.com/Swatinem/rust-cache.git
synced 2024-11-23 06:16:07 +08:00
Clean up credentials.toml
This commit is contained in:
parent
5ec9842c14
commit
80c47cc945
7
dist/restore/index.js
vendored
7
dist/restore/index.js
vendored
@ -67272,6 +67272,13 @@ async function cleanBin(oldBins) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function cleanRegistry(packages, crates = true) {
|
async function cleanRegistry(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`
|
// `.cargo/registry/index`
|
||||||
let pkgSet = new Set(packages.map((p) => p.name));
|
let pkgSet = new Set(packages.map((p) => p.name));
|
||||||
const indexDir = await fs.promises.opendir(path.join(CARGO_HOME, "registry", "index"));
|
const indexDir = await fs.promises.opendir(path.join(CARGO_HOME, "registry", "index"));
|
||||||
|
7
dist/save/index.js
vendored
7
dist/save/index.js
vendored
@ -67272,6 +67272,13 @@ async function cleanBin(oldBins) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function cleanRegistry(packages, crates = true) {
|
async function cleanRegistry(packages, crates = true) {
|
||||||
|
// remove `.cargo/credentials.toml`
|
||||||
|
try {
|
||||||
|
const credentials = external_path_default().join(CARGO_HOME, ".cargo", "credentials.toml");
|
||||||
|
core.debug(`deleting "${credentials}"`);
|
||||||
|
await external_fs_default().promises.unlink(credentials);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
// `.cargo/registry/index`
|
// `.cargo/registry/index`
|
||||||
let pkgSet = new Set(packages.map((p) => p.name));
|
let pkgSet = new Set(packages.map((p) => p.name));
|
||||||
const indexDir = await external_fs_default().promises.opendir(external_path_default().join(CARGO_HOME, "registry", "index"));
|
const indexDir = await external_fs_default().promises.opendir(external_path_default().join(CARGO_HOME, "registry", "index"));
|
||||||
|
@ -91,6 +91,13 @@ export async function cleanBin(oldBins: Array<string>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function cleanRegistry(packages: Packages, crates = true) {
|
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`
|
// `.cargo/registry/index`
|
||||||
let pkgSet = new Set(packages.map((p) => p.name));
|
let pkgSet = new Set(packages.map((p) => p.name));
|
||||||
const indexDir = await fs.promises.opendir(path.join(CARGO_HOME, "registry", "index"));
|
const indexDir = await fs.promises.opendir(path.join(CARGO_HOME, "registry", "index"));
|
||||||
|
Loading…
Reference in New Issue
Block a user