mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 16:30:52 +08:00
@@ -11,10 +11,6 @@ const cwd = process.cwd();
|
||||
const TEMP_DIR = path.join(cwd, "node_modules/.verge");
|
||||
const FORCE = process.argv.includes("--force");
|
||||
|
||||
const SIDECAR_HOST = execSync("rustc -vV")
|
||||
.toString()
|
||||
.match(/(?<=host: ).+(?=\s*)/g)[0];
|
||||
|
||||
/* ======= clash =======
|
||||
const CLASH_STORAGE_PREFIX = "https://release.dreamacro.workers.dev/";
|
||||
const CLASH_URL_PREFIX =
|
||||
@@ -42,6 +38,7 @@ const META_URL_PREFIX = `https://github.com/wonfen/Clash.Meta/releases/download/
|
||||
|
||||
const META_MAP = {
|
||||
"win32-x64": "clash.meta-win-amd64",
|
||||
"win32-arm64": "clash.meta-win-arm64",
|
||||
"darwin-x64": "clash.meta-darwin-amd64",
|
||||
"darwin-arm64": "clash.meta-darwin-arm64",
|
||||
"linux-x64": "clash.meta-linux-amd64",
|
||||
@@ -51,8 +48,33 @@ const META_MAP = {
|
||||
/*
|
||||
* check available
|
||||
*/
|
||||
const PLATFORM_MAP = {
|
||||
"x86_64-pc-windows-msvc": "win32",
|
||||
"aarch64-pc-windows-msvc": "win32",
|
||||
"x86_64-apple-darwin": "darwin",
|
||||
"aarch64-apple-darwin": "darwin",
|
||||
"x86_64-unknown-linux-gnu": "linux",
|
||||
"aarch64-unknown-linux-gnu": "linux",
|
||||
};
|
||||
const ARCH_MAP = {
|
||||
"x86_64-pc-windows-msvc": "x64",
|
||||
"aarch64-pc-windows-msvc": "arm64",
|
||||
"x86_64-apple-darwin": "x64",
|
||||
"aarch64-apple-darwin": "arm64",
|
||||
"x86_64-unknown-linux-gnu": "x64",
|
||||
"aarch64-unknown-linux-gnu": "arm64",
|
||||
};
|
||||
|
||||
const { platform, arch } = process;
|
||||
const target = process.argv.slice(2)[0];
|
||||
const { platform, arch } = target
|
||||
? { platform: PLATFORM_MAP[target], arch: ARCH_MAP[target] }
|
||||
: process;
|
||||
|
||||
const SIDECAR_HOST = target
|
||||
? target
|
||||
: execSync("rustc -vV")
|
||||
.toString()
|
||||
.match(/(?<=host: ).+(?=\s*)/g)[0];
|
||||
/*
|
||||
if (!CLASH_MAP[`${platform}-${arch}`]) {
|
||||
throw new Error(`clash unsupported platform "${platform}-${arch}"`);
|
||||
|
||||
@@ -45,6 +45,7 @@ async function resolveUpdater() {
|
||||
"darwin-intel": { signature: "", url: "" },
|
||||
"darwin-x86_64": { signature: "", url: "" },
|
||||
"linux-x86_64": { signature: "", url: "" },
|
||||
"linux-aarch64": { signature: "", url: "" },
|
||||
"windows-x86_64": { signature: "", url: "" },
|
||||
},
|
||||
};
|
||||
@@ -92,12 +93,16 @@ async function resolveUpdater() {
|
||||
if (name.endsWith(".AppImage.tar.gz")) {
|
||||
updateData.platforms.linux.url = browser_download_url;
|
||||
updateData.platforms["linux-x86_64"].url = browser_download_url;
|
||||
// 暂时使用x64版本的url和sig,使得可以检查更新,但aarch64版本还不支持构建appimage
|
||||
updateData.platforms["linux-aarch64"].url = browser_download_url;
|
||||
}
|
||||
// linux signature
|
||||
if (name.endsWith(".AppImage.tar.gz.sig")) {
|
||||
const sig = await getSignature(browser_download_url);
|
||||
updateData.platforms.linux.signature = sig;
|
||||
updateData.platforms["linux-x86_64"].signature = sig;
|
||||
// 暂时使用x64版本的url和sig,使得可以检查更新,但aarch64版本还不支持构建appimage
|
||||
updateData.platforms["linux-aarch64"].url = browser_download_url;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user