mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-18 04:28:28 +02:00
format
This commit is contained in:
parent
a25a0f3a6e
commit
a70f372af9
2 changed files with 4 additions and 8 deletions
|
@ -74,9 +74,7 @@ export default async (options: Input): Promise<Output> => {
|
||||||
let revision: string | undefined;
|
let revision: string | undefined;
|
||||||
let cacheHit = false;
|
let cacheHit = false;
|
||||||
if (cacheEnabled) {
|
if (cacheEnabled) {
|
||||||
const cacheKey = createHash('sha1')
|
const cacheKey = createHash("sha1").update(url).digest("base64");
|
||||||
.update(url)
|
|
||||||
.digest('base64');
|
|
||||||
|
|
||||||
const cacheRestored = await restoreCache([bunPath], cacheKey);
|
const cacheRestored = await restoreCache([bunPath], cacheKey);
|
||||||
if (cacheRestored) {
|
if (cacheRestored) {
|
||||||
|
|
|
@ -6,9 +6,7 @@ import { createHash } from "node:crypto";
|
||||||
(async () => {
|
(async () => {
|
||||||
const state: CacheState = JSON.parse(getState("cache"));
|
const state: CacheState = JSON.parse(getState("cache"));
|
||||||
if (state.cacheEnabled && !state.cacheHit) {
|
if (state.cacheEnabled && !state.cacheHit) {
|
||||||
const cacheKey = createHash('sha1')
|
const cacheKey = createHash("sha1").update(state.url).digest("base64");
|
||||||
.update(state.url)
|
|
||||||
.digest('base64');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await saveCache([state.bunPath], cacheKey);
|
await saveCache([state.bunPath], cacheKey);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue