Skip to content

Commit

Permalink
Rebuild dist
Browse files Browse the repository at this point in the history
  • Loading branch information
DelevoXDG committed Oct 9, 2024
1 parent 58a3e0f commit 11d9eac
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
10 changes: 6 additions & 4 deletions dist/cache-save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73693,9 +73693,11 @@ function wellKnownCachePath() {
}
}

async function getCacheKey() {
async function getCacheKey(scarbLockfilePath) {
const platform = process.env.RUNNER_OS;
const fileHash = await glob.hashFiles(await getScarbLockfilePath());
const fileHash = await glob.hashFiles(
await getScarbLockfilePath(scarbLockfilePath),
);

if (!fileHash) {
throw new Error(
Expand All @@ -73706,8 +73708,8 @@ async function getCacheKey() {
return `scarb-cache-${platform}-${fileHash}`.toLowerCase();
}

async function getScarbLockfilePath() {
const lockfilePath = path.join(process.env.GITHUB_WORKSPACE, "Scarb.lock");
async function getScarbLockfilePath(scarbLockfilePath) {
const lockfilePath = scarbLockfilePath || "Scarb.lock";

await fs.access(lockfilePath).catch((_) => {
throw new Error("failed to find Scarb.lock");
Expand Down
2 changes: 1 addition & 1 deletion dist/cache-save/index.js.map

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74790,9 +74790,11 @@ function wellKnownCachePath() {
}
}

async function getCacheKey() {
async function getCacheKey(scarbLockfilePath) {
const platform = process.env.RUNNER_OS;
const fileHash = await glob.hashFiles(await getScarbLockfilePath());
const fileHash = await glob.hashFiles(
await getScarbLockfilePath(scarbLockfilePath),
);

if (!fileHash) {
throw new Error(
Expand All @@ -74803,8 +74805,8 @@ async function getCacheKey() {
return `scarb-cache-${platform}-${fileHash}`.toLowerCase();
}

async function getScarbLockfilePath() {
const lockfilePath = external_path_default().join(process.env.GITHUB_WORKSPACE, "Scarb.lock");
async function getScarbLockfilePath(scarbLockfilePath) {
const lockfilePath = scarbLockfilePath || "Scarb.lock";

await promises_default().access(lockfilePath).catch((_) => {
throw new Error("failed to find Scarb.lock");
Expand All @@ -74821,13 +74823,13 @@ async function getScarbLockfilePath() {



async function restoreCache() {
async function restoreCache(scarbLockPath) {
const cacheDir = await getCacheDirectory();
await promises_default().mkdir(cacheDir, { recursive: true });

core.info(`Restoring Scarb cache into ${cacheDir}`);

const primaryKey = await getCacheKey();
const primaryKey = await getCacheKey(scarbLockPath);
core.info(`Cache primary key is ${primaryKey}`);
core.saveState(State.CachePrimaryKey, primaryKey);

Expand All @@ -74853,6 +74855,7 @@ async function main() {
try {
const scarbVersionInput = core.getInput("scarb-version");
const toolVersionsPathInput = core.getInput("tool-versions");
const scarbLockPathInput = core.getInput("scarb-lock");

const { repo: scarbRepo, version: scarbVersion } = await determineVersion(
scarbVersionInput,
Expand Down Expand Up @@ -74886,7 +74889,7 @@ async function main() {

core.setOutput("scarb-version", await getFullVersionFromScarb());

await restoreCache().catch((e) => {
await restoreCache(scarbLockPathInput).catch((e) => {
core.error(
`There was an error when restoring cache: ${
e instanceof Error ? e.message : e
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js.map

Large diffs are not rendered by default.

0 comments on commit 11d9eac

Please sign in to comment.