mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-08-02 01:08:41 +02:00
feat: xray support
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { execSync, execFileSync } from "node:child_process";
|
||||
import { execFileSync, execSync } from "node:child_process";
|
||||
import { copyFileSync, existsSync, mkdirSync } from "node:fs";
|
||||
import { join, dirname } from "node:path";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { downloadXray } from "./download-xray.mjs";
|
||||
|
||||
const MANIFEST_DIR = dirname(fileURLToPath(import.meta.url));
|
||||
const PROFILE =
|
||||
@@ -35,9 +36,18 @@ const isWindows = TARGET.includes("windows");
|
||||
// Determine source directory
|
||||
let srcDir;
|
||||
if (TARGET === HOST_TARGET || TARGET === "unknown") {
|
||||
srcDir = join(MANIFEST_DIR, "target", PROFILE === "release" ? "release" : "debug");
|
||||
srcDir = join(
|
||||
MANIFEST_DIR,
|
||||
"target",
|
||||
PROFILE === "release" ? "release" : "debug",
|
||||
);
|
||||
} else {
|
||||
srcDir = join(MANIFEST_DIR, "target", TARGET, PROFILE === "release" ? "release" : "debug");
|
||||
srcDir = join(
|
||||
MANIFEST_DIR,
|
||||
"target",
|
||||
TARGET,
|
||||
PROFILE === "release" ? "release" : "debug",
|
||||
);
|
||||
}
|
||||
|
||||
const destDir = join(MANIFEST_DIR, "binaries");
|
||||
@@ -70,3 +80,4 @@ function copyBinary(baseName) {
|
||||
}
|
||||
|
||||
copyBinary("donut-proxy");
|
||||
await downloadXray(TARGET);
|
||||
|
||||
Reference in New Issue
Block a user