Skip to content
Snippets Groups Projects
Unverified Commit f7500f4c authored by GyDi's avatar GyDi
Browse files

chore: clash meta compatible and geosite.dat

parent 0cfd718d
No related branches found
No related tags found
No related merge requests found
......@@ -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);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment