Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: check if rpc cache exists on save
  • Loading branch information
PaulRBerg committed Jan 12, 2023
commit 21bb2a2661ed688e245eb1cf3c7ff2a97babb5f5
5 changes: 4 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68341,6 +68341,7 @@ function wrappy (fn, cb) {

const cache = __nccwpck_require__(7799);
const github = __nccwpck_require__(5438);
const fs = __nccwpck_require__(7147);
const os = __nccwpck_require__(2037);

const CACHE_PATHS = ["~/.foundry/cache/rpc"];
Expand All @@ -68355,7 +68356,9 @@ async function restoreRPCCache() {
async function saveCache() {
const platform = os.platform();
const key = platform + "-foundry-chain-fork-" + github.context.sha;
await cache.saveCache(CACHE_PATHS, key);
if (fs.existsSync(CACHE_PATHS[0])) {
await cache.saveCache(CACHE_PATHS, key);
}
}

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66834,6 +66834,7 @@ function wrappy (fn, cb) {

const cache = __nccwpck_require__(7799);
const github = __nccwpck_require__(5438);
const fs = __nccwpck_require__(7147);
const os = __nccwpck_require__(2037);

const CACHE_PATHS = ["~/.foundry/cache/rpc"];
Expand All @@ -66848,7 +66849,9 @@ async function restoreRPCCache() {
async function saveCache() {
const platform = os.platform();
const key = platform + "-foundry-chain-fork-" + github.context.sha;
await cache.saveCache(CACHE_PATHS, key);
if (fs.existsSync(CACHE_PATHS[0])) {
await cache.saveCache(CACHE_PATHS, key);
}
}

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion dist/save/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/cache.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const cache = require("@actions/cache");
const github = require("@actions/github");
const fs = require("fs");
const os = require("os");

const CACHE_PATHS = ["~/.foundry/cache/rpc"];
Expand All @@ -14,7 +15,9 @@ async function restoreRPCCache() {
async function saveCache() {
const platform = os.platform();
const key = platform + "-foundry-chain-fork-" + github.context.sha;
await cache.saveCache(CACHE_PATHS, key);
if (fs.existsSync(CACHE_PATHS[0])) {
await cache.saveCache(CACHE_PATHS, key);
}
}

module.exports = {
Expand Down