Skip to content

Commit

Permalink
chore: use clash meta v1.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
keiko233 committed Dec 3, 2023
1 parent 8d76f7a commit 93fe0ca
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions scripts/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ const RS_MAP = {
};

/* ======= clash meta ======= */
let META_VERSION = "v1.17.0";
const VERSION_URL =
"https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/version.txt";
const META_URL_PREFIX = `https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha`;
let META_VERSION;
const META_URL_PREFIX = META_VERSION
? `https://github.com/MetaCubeX/mihomo/releases/download/${META_VERSION}`
: `https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha`;

const META_MAP = {
"win32-x64": "mihomo-windows-amd64-compatible",
Expand Down Expand Up @@ -173,9 +175,11 @@ function clashRs(): BinInfo {

async function getLatestVersion() {
try {
const response = await fetch(VERSION_URL, { method: "GET" });
const v = await response.text();
META_VERSION = v.trim();
if (!META_VERSION) {
const response = await fetch(VERSION_URL, { method: "GET" });
const v = await response.text();
META_VERSION = v.trim();
}
console.log(`Latest release version: ${META_VERSION}`);
} catch (error) {
console.error("Error fetching latest release version:", error.message);
Expand Down

0 comments on commit 93fe0ca

Please sign in to comment.