From db1906c32a21b084bd8b76567b319b4a25fe3c90 Mon Sep 17 00:00:00 2001 From: Slava-Shchipunov Date: Wed, 18 Sep 2024 12:14:34 +0700 Subject: [PATCH] feat: get jobConfig to SNAPSHOTS --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 3db329e..675b44e 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ if (!version) { process.exit(1); } -const url = `https://downloads.openwrt.org/releases/${version}/targets/`; +const url = version === 'SNAPSHOT' ? 'https://downloads.openwrt.org/snapshots/targets/' : `https://downloads.openwrt.org/releases/${version}/targets/`; async function fetchHTML(url) { try { @@ -54,7 +54,7 @@ async function getDetails(target, subtarget) { $('a').each((index, element) => { const name = $(element).attr('href'); if (name && name.startsWith('kernel_')) { - const vermagicMatch = name.match(/kernel_5\.\d+\.\d+-\d+-([a-f0-9]+)_([a-zA-Z0-9_-]+)\.ipk$/); + const vermagicMatch = name.match(/kernel_\d+\.\d+\.\d+(?:-\d+)?[-~]([a-f0-9]+)(?:-r\d+)?_([a-zA-Z0-9_-]+)\.ipk$/); if (vermagicMatch) { vermagic = vermagicMatch[1]; pkgarch = vermagicMatch[2];