Skip to content

Commit

Permalink
update lockfile path search
Browse files Browse the repository at this point in the history
  • Loading branch information
tomek0123456789 committed Dec 15, 2023
1 parent 064ca49 commit 6717c32
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 23 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/setup-scarb.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions dist/cache-save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59399,6 +59399,8 @@ var external_os_default = /*#__PURE__*/__nccwpck_require__.n(external_os_);
// EXTERNAL MODULE: external "path"
var external_path_ = __nccwpck_require__(1017);
var external_path_default = /*#__PURE__*/__nccwpck_require__.n(external_path_);
;// CONCATENATED MODULE: external "fs/promises"
const promises_namespaceObject = require("fs/promises");
;// CONCATENATED MODULE: ./lib/cache-utils.js


Expand All @@ -59407,6 +59409,7 @@ var external_path_default = /*#__PURE__*/__nccwpck_require__.n(external_path_);




const State = {
CachePrimaryKey: "primary_key",
CacheMatchedKey: "matched_key",
Expand Down Expand Up @@ -59469,16 +59472,13 @@ async function getCacheKey() {
}

async function getScarbLockfilePath() {
const globber = await glob.create("**/Scarb.lock");
const lockfiles = await globber.glob();
const lockfilePath = path.join(process.env.GITHUB_WORKSPACE, "Scarb.lock");

if (lockfiles.length === 0) {
await fs.access(lockfilePath).catch((_) => {
throw new Error("failed to find Scarb.lock");
}
});

return lockfiles.reduce((prev, next) =>
prev.length < next.length ? prev : next,
);
return lockfilePath;
}

;// CONCATENATED MODULE: ./lib/cache-save.js
Expand Down
2 changes: 1 addition & 1 deletion dist/cache-save/index.js.map

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60590,6 +60590,7 @@ var glob = __nccwpck_require__(8090);




const State = {
CachePrimaryKey: "primary_key",
CacheMatchedKey: "matched_key",
Expand Down Expand Up @@ -60652,16 +60653,13 @@ async function getCacheKey() {
}

async function getScarbLockfilePath() {
const globber = await glob.create("**/Scarb.lock");
const lockfiles = await globber.glob();
const lockfilePath = external_path_default().join(process.env.GITHUB_WORKSPACE, "Scarb.lock");

if (lockfiles.length === 0) {
await promises_default().access(lockfilePath).catch((_) => {
throw new Error("failed to find Scarb.lock");
}
});

return lockfiles.reduce((prev, next) =>
prev.length < next.length ? prev : next,
);
return lockfilePath;
}

;// CONCATENATED MODULE: ./lib/cache-restore.js
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js.map

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions lib/cache-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as glob from "@actions/glob";

import os from "os";
import path from "path";
import fs from "fs/promises";

export const State = {
CachePrimaryKey: "primary_key",
Expand Down Expand Up @@ -67,14 +68,11 @@ export async function getCacheKey() {
}

async function getScarbLockfilePath() {
const globber = await glob.create("**/Scarb.lock");
const lockfiles = await globber.glob();
const lockfilePath = path.join(process.env.GITHUB_WORKSPACE, "Scarb.lock");

if (lockfiles.length === 0) {
await fs.access(lockfilePath).catch((_) => {
throw new Error("failed to find Scarb.lock");
}
});

return lockfiles.reduce((prev, next) =>
prev.length < next.length ? prev : next,
);
return lockfilePath;
}

0 comments on commit 6717c32

Please sign in to comment.