3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-07-31 18:33:20 +00:00

fix paths for cache dir

This commit is contained in:
Jonathan Kelley 2025-01-28 22:02:28 -08:00
parent b37d2821f8
commit 64b8867183
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
2 changed files with 28 additions and 19 deletions

9
dist/save/index.js vendored
View file

@ -87370,6 +87370,7 @@ async function run() {
// Save the incremental cache before we delete it
if (config.incremental) {
core.info(`... Saving incremental cache ...`);
try {
core.debug(`paths include ${config.incrementalPaths} with key ${config.incrementalKey}`);
for (const paths of config.incrementalPaths) {
await saveIncrementalDirs(paths);
@ -87380,6 +87381,11 @@ async function run() {
await (0,promises_.rm)(path);
}
}
catch (e) {
core.debug(`Failed to save incremental cache`);
core.debug(`${e.stack}`);
}
}
const allPackages = [];
for (const workspace of config.workspaces) {
const packages = await workspace.getPackagesOutsideWorkspaceRoot();
@ -87436,9 +87442,8 @@ async function macOsWorkaround() {
}
catch { }
}
async function saveIncrementalDirs(profileDir) {
async function saveIncrementalDirs(incrementalDir) {
// Traverse the incremental folder recursively and collect the modified times in a map
const incrementalDir = external_path_default().join(profileDir, "incremental");
const modifiedTimes = new Map();
const fillModifiedTimes = async (dir) => {
const dirEntries = await external_fs_default().promises.opendir(dir);

View file

@ -42,6 +42,7 @@ async function run() {
// Save the incremental cache before we delete it
if (config.incremental) {
core.info(`... Saving incremental cache ...`);
try {
core.debug(`paths include ${config.incrementalPaths} with key ${config.incrementalKey}`);
for (const paths of config.incrementalPaths) {
await saveIncrementalDirs(paths);
@ -51,6 +52,10 @@ async function run() {
core.debug(` deleting ${path}`);
await rm(path);
}
} catch (e) {
core.debug(`Failed to save incremental cache`);
core.debug(`${(e as any).stack}`);
}
}
const allPackages = [];
@ -112,9 +117,8 @@ async function macOsWorkaround() {
}
async function saveIncrementalDirs(profileDir: string) {
async function saveIncrementalDirs(incrementalDir: string) {
// Traverse the incremental folder recursively and collect the modified times in a map
const incrementalDir = path.join(profileDir, "incremental");
const modifiedTimes = new Map<string, number>();
const fillModifiedTimes = async (dir: string) => {
const dirEntries = await fs.promises.opendir(dir);