mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-04-08 22:10:10 +08:00
16 lines
425 B
TypeScript
16 lines
425 B
TypeScript
import { saveCache } from "@actions/cache";
|
|
import { getState, warning } from "@actions/core";
|
|
import { CacheState } from "./action";
|
|
|
|
(async () => {
|
|
const state: CacheState = JSON.parse(getState("cache"));
|
|
if (state.cacheEnabled && !state.cacheHit) {
|
|
try {
|
|
await saveCache([state.bunPath], state.url);
|
|
process.exit(0);
|
|
} catch (error) {
|
|
warning("Failed to save Bun to cache.");
|
|
}
|
|
}
|
|
})();
|