mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 21:40:01 +00:00
Check paths first.
This commit is contained in:
parent
e00bf43167
commit
e6a829b5bd
3 changed files with 16 additions and 3 deletions
11
src/cargo.ts
11
src/cargo.ts
|
@ -165,12 +165,21 @@ export async function saveCache() {
|
|||
return;
|
||||
}
|
||||
|
||||
const cachePaths = getCachePaths();
|
||||
|
||||
for (const cachePath of cachePaths) {
|
||||
if (!fs.existsSync(cachePath)) {
|
||||
core.info(`Cache path ${cachePath} does not exist, skipping save`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await cleanCargoRegistry();
|
||||
await cleanTargetProfile();
|
||||
|
||||
core.info(`Saving cache with key ${primaryKey}`);
|
||||
|
||||
await cache.saveCache(getCachePaths(), primaryKey);
|
||||
await cache.saveCache(cachePaths, primaryKey);
|
||||
}
|
||||
|
||||
export async function restoreCache() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue