feat: get jobConfig to SNAPSHOTS

This commit is contained in:
Slava-Shchipunov
2024-09-18 12:14:34 +07:00
parent 27196b2ada
commit db1906c32a

View File

@@ -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];