Skip to content

Commit 21bb2a2

Browse files
committed
fix: check if rpc cache exists on save
1 parent fceaa77 commit 21bb2a2

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

dist/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -68341,6 +68341,7 @@ function wrappy (fn, cb) {
6834168341

6834268342
const cache = __nccwpck_require__(7799);
6834368343
const github = __nccwpck_require__(5438);
68344+
const fs = __nccwpck_require__(7147);
6834468345
const os = __nccwpck_require__(2037);
6834568346

6834668347
const CACHE_PATHS = ["~/.foundry/cache/rpc"];
@@ -68355,7 +68356,9 @@ async function restoreRPCCache() {
6835568356
async function saveCache() {
6835668357
const platform = os.platform();
6835768358
const key = platform + "-foundry-chain-fork-" + github.context.sha;
68358-
await cache.saveCache(CACHE_PATHS, key);
68359+
if (fs.existsSync(CACHE_PATHS[0])) {
68360+
await cache.saveCache(CACHE_PATHS, key);
68361+
}
6835968362
}
6836068363

6836168364
module.exports = {

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/save/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -66834,6 +66834,7 @@ function wrappy (fn, cb) {
6683466834

6683566835
const cache = __nccwpck_require__(7799);
6683666836
const github = __nccwpck_require__(5438);
66837+
const fs = __nccwpck_require__(7147);
6683766838
const os = __nccwpck_require__(2037);
6683866839

6683966840
const CACHE_PATHS = ["~/.foundry/cache/rpc"];
@@ -66848,7 +66849,9 @@ async function restoreRPCCache() {
6684866849
async function saveCache() {
6684966850
const platform = os.platform();
6685066851
const key = platform + "-foundry-chain-fork-" + github.context.sha;
66851-
await cache.saveCache(CACHE_PATHS, key);
66852+
if (fs.existsSync(CACHE_PATHS[0])) {
66853+
await cache.saveCache(CACHE_PATHS, key);
66854+
}
6685266855
}
6685366856

6685466857
module.exports = {

dist/save/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cache.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const cache = require("@actions/cache");
22
const github = require("@actions/github");
3+
const fs = require("fs");
34
const os = require("os");
45

56
const CACHE_PATHS = ["~/.foundry/cache/rpc"];
@@ -14,7 +15,9 @@ async function restoreRPCCache() {
1415
async function saveCache() {
1516
const platform = os.platform();
1617
const key = platform + "-foundry-chain-fork-" + github.context.sha;
17-
await cache.saveCache(CACHE_PATHS, key);
18+
if (fs.existsSync(CACHE_PATHS[0])) {
19+
await cache.saveCache(CACHE_PATHS, key);
20+
}
1821
}
1922

2023
module.exports = {

0 commit comments

Comments
 (0)