Skip to content

Commit

Permalink
fix: build index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
qcuong98 committed Feb 15, 2025
1 parent d2d3d09 commit 343f584
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75412,7 +75412,10 @@ if (require.main === require.cache[eval('__filename')]) {
const os = __nccwpck_require__(857);

function normalizeVersionName(version) {
return version.replace(/^nightly-[0-9a-f]{40}$/, "nightly");
if (/^nightly-[0-9a-f]{40}$/.test(version)) {
return "nightly";
}
return version.replace(/-/g, "_");
}

function mapArch(arch) {
Expand All @@ -75426,7 +75429,16 @@ function mapArch(arch) {

function getDownloadObject(version) {
const platform = os.platform();
const filename = `foundry_${normalizeVersionName(version)}_${platform}_${mapArch(os.arch())}`;
let filename;

if (version.startsWith("foundry")) {
// If version starts with "foundry", don't add the prefix.
filename = `${normalizeVersionName(version)}_${platform}_${mapArch(os.arch())}`;
} else {
// Otherwise, add the "foundry_" prefix.
filename = `foundry_${normalizeVersionName(version)}_${platform}_${mapArch(os.arch())}`;
}

const extension = platform === "win32" ? "zip" : "tar.gz";
const url = `https://github.com/matter-labs/foundry-zksync/releases/download/${version}/${filename}.${extension}`;

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit 343f584

Please sign in to comment.