(entries)
| 53 | } |
| 54 | |
| 55 | function hydrateEntries(entries) { |
| 56 | const sourceRoots = cacheSourceRoots(); |
| 57 | for (const entry of entries) { |
| 58 | const destination = join(ROOT, entry.destination); |
| 59 | if (existsAndHasContent(destination) && !force) { |
| 60 | log(`skip ${entry.label}; ${entry.destination} already exists`); |
| 61 | continue; |
| 62 | } |
| 63 | |
| 64 | const source = findHydrationSource(entry, sourceRoots); |
| 65 | if (!source) { |
| 66 | log(`miss ${entry.label}`); |
| 67 | continue; |
| 68 | } |
| 69 | |
| 70 | copyIntoPlace(source.path, destination); |
| 71 | log(`hydrated ${entry.label} from ${source.description}`); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | function saveEntries(entries) { |
| 76 | mkdirSync(CACHE_ROOT, { recursive: true }); |
no test coverage detected