mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-17 20:18:24 +02:00
Caching fix
This commit is contained in:
parent
9b0a10bfca
commit
11022e311a
2 changed files with 28 additions and 25 deletions
46
dist/setup/index.js
generated
vendored
46
dist/setup/index.js
generated
vendored
File diff suppressed because one or more lines are too long
|
@ -80,12 +80,15 @@ export default async (options: Input): Promise<Output> => {
|
|||
const cacheKeyBase = createHash("sha1").update(url).digest("base64")
|
||||
const cacheKey = `${cacheKeyBase}-${options.extraKey ?? "default"}`
|
||||
if (cacheEnabled) {
|
||||
const cacheRestored = await restoreCache([bunPath], cacheKey, [cacheKeyBase]);
|
||||
const cacheRestored = await restoreCache([bunPath, cachePath], cacheKey, [cacheKeyBase]);
|
||||
if (cacheRestored) {
|
||||
revision = await getRevision(bunPath);
|
||||
if (revision) {
|
||||
cacheHit = true;
|
||||
info(`Using a cached version of Bun: ${revision}`);
|
||||
if(cacheRestored === cacheKey){
|
||||
info(`Cache hit with key: ${cacheRestored}`);
|
||||
cacheHit = true;
|
||||
}
|
||||
} else {
|
||||
warning(
|
||||
`Found a cached version of Bun: ${revision} (but it appears to be corrupted?)`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue