From 48ee01cdc7d3f59602dbefba394a1342a29750e6 Mon Sep 17 00:00:00 2001 From: hensm Date: Mon, 7 Sep 2020 19:37:01 +0100 Subject: [PATCH] Ignore x86 Windows binary when populating site download buttons --- docs/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/index.js b/docs/index.js index 0a854ea..14ececa 100644 --- a/docs/index.js +++ b/docs/index.js @@ -97,7 +97,10 @@ function onResponse (res) { for (const asset of res.assets) { const formattedSize = formatSize(asset.size); - switch (asset.name.match(/.*\.(.*)$/).pop()) { + const REGEX_EXT = /.*\.(.*)$/; + const REGEX_ARCH = /.*(x(?:86|64))\..*$/; + + switch (asset.name.match(REGEX_EXT).pop()) { case "xpi": downloadExtBtn.href = asset.browser_download_url; downloadExtBtn.dataset.version = res.tag_name; @@ -107,6 +110,11 @@ function onResponse (res) { case "exe": + const arch = asset.name.match(REGEX_ARCH).pop(); + if (arch !== "x64") { + break; + } + populateAppListApp( appListWinBtn, asset.browser_download_url , asset.name, formattedSize);