mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 11:42:21 +08:00
chore: clash meta compatible and geosite.dat
This commit is contained in:
parent
0cfd718d8a
commit
f7500f4cad
|
@ -56,7 +56,7 @@ async function resolveClashMeta() {
|
|||
const latestVersion = "v1.13.2";
|
||||
|
||||
const map = {
|
||||
"win32-x64": "Clash.Meta-windows-amd64",
|
||||
"win32-x64": "Clash.Meta-windows-amd64-compatible",
|
||||
"darwin-x64": "Clash.Meta-darwin-amd64",
|
||||
"darwin-arm64": "Clash.Meta-darwin-arm64",
|
||||
"linux-x64": "Clash.Meta-linux-amd64-compatible",
|
||||
|
@ -271,6 +271,38 @@ async function resolveMmdb() {
|
|||
await downloadFile(url, resPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the geosite.dat for meta
|
||||
*/
|
||||
async function resolveGeosite() {
|
||||
const url =
|
||||
"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat";
|
||||
|
||||
const resDir = path.join(cwd, "src-tauri", "resources");
|
||||
const resPath = path.join(resDir, "geosite.dat");
|
||||
|
||||
if (!FORCE && (await fs.pathExists(resPath))) return;
|
||||
|
||||
await fs.mkdirp(resDir);
|
||||
await downloadFile(url, resPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the geoip.dat for meta
|
||||
*/
|
||||
async function resolveGeoIP() {
|
||||
const url =
|
||||
"https://github.com/Loyalsoldier/geoip/releases/latest/download/geoip.dat";
|
||||
|
||||
const resDir = path.join(cwd, "src-tauri", "resources");
|
||||
const resPath = path.join(resDir, "geoip.dat");
|
||||
|
||||
if (!FORCE && (await fs.pathExists(resPath))) return;
|
||||
|
||||
await fs.mkdirp(resDir);
|
||||
await downloadFile(url, resPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* download file and save to `path`
|
||||
*/
|
||||
|
@ -302,6 +334,14 @@ async function downloadFile(url, path) {
|
|||
|
||||
/// main
|
||||
resolveSidecar().catch(console.error);
|
||||
resolveWintun().catch(console.error);
|
||||
resolveMmdb().catch(console.error);
|
||||
resolveService().catch(console.error);
|
||||
resolveWintun()
|
||||
.catch(console.error)
|
||||
.finally(() => {
|
||||
resolveService().catch(console.error);
|
||||
});
|
||||
resolveMmdb()
|
||||
.catch(console.error)
|
||||
.finally(() => {
|
||||
resolveGeosite().catch(console.error);
|
||||
// resolveGeoIP().catch(console.error);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user