mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 07:40:22 +08:00
fix: 收录 DSH NEXT 识别与单测(#174 #175)
Co-authored-by: Cursor <cursoragent@cursor.com> #171/#173 已在 1.1.80;#174 按官方 asar 路径认 DSH NEXT,不把任意 app.asar 当桌面。
This commit is contained in:
1 parent
fee23ac031
commit
5344d7e1cb
14 files changed
+322
-862
No files matched your search
+12
-1
@@ -31,12 +31,17 @@ export function pathLooksDesktop(p) {
|
||||
n.includes("/dsh desktop.app/") ||
|
||||
n.includes("dsh-desktop") ||
|
||||
n.includes("dsh-plugin-desktop") ||
|
||||
n.includes("dsh-desktop-next") ||
|
||||
n.includes("/dsh next/") ||
|
||||
n.includes("/dsh next.app/") ||
|
||||
n.includes("dsh-next") ||
|
||||
n.includes("/deepseek bot/") ||
|
||||
n.includes("/deepseek-bot/") ||
|
||||
n.includes("/ds-bot/") ||
|
||||
n.includes("/deepseek harness.app/") ||
|
||||
(harnessDir && (n.includes("/resources/") || n.includes("/contents/resources/") || n.endsWith("/resources"))) ||
|
||||
/\/dsh desktop\.exe$/i.test(n) ||
|
||||
/\/dsh next\.exe$/i.test(n) ||
|
||||
/\/deepseek[\s._-]*harness\.exe$/i.test(n) ||
|
||||
n.endsWith("/host-process-entry.js") ||
|
||||
n.endsWith("/desktop-cli.js")
|
||||
@@ -64,11 +69,14 @@ export function isCommunityElectronHost(input = {}) {
|
||||
const env = input.env ?? process.env;
|
||||
const profile = norm(env.DSH_PROFILE);
|
||||
if (profile === "ds-bot" || profile === "dsbot" || profile === "deepseek-bot") return true;
|
||||
if (profile === "dsh-next" || profile === "dshnext" || profile === "dsh next") return true;
|
||||
const execPath = input.execPath ?? process.execPath;
|
||||
const name = exeName(execPath);
|
||||
if (/^deepseek[\s._-]*bot(\.exe)?$/.test(name) || /^ds[\s._-]*bot(\.exe)?$/.test(name)) return true;
|
||||
if (/^dsh[\s._-]*next(\.exe)?$/.test(name)) return true;
|
||||
const p = slash(execPath);
|
||||
if (p.includes("/deepseek bot") || p.includes("/deepseek-bot") || p.includes("/ds-bot/") || p.endsWith("/ds-bot")) return true;
|
||||
if (p.includes("/dsh next") || p.includes("/dsh-next")) return true;
|
||||
const resourcesPath = input.resourcesPath ?? process.resourcesPath;
|
||||
const electron = (input.versions ?? process.versions)?.electron;
|
||||
if (electron && resourcesLookLikeDesktopInstall(resourcesPath)) return true;
|
||||
@@ -87,11 +95,14 @@ export function isDesktopSurface(input = {}) {
|
||||
if (
|
||||
name === "dsh desktop.exe" ||
|
||||
name === "dsh desktop" ||
|
||||
name === "dsh next.exe" ||
|
||||
name === "dsh next" ||
|
||||
name === "deepseek harness.exe" ||
|
||||
name === "deepseek-harness.exe" ||
|
||||
name === "deepseek harness" ||
|
||||
name === "deepseek-harness" ||
|
||||
/^deepseek[\s._-]*harness(\.exe)?$/.test(name)
|
||||
/^deepseek[\s._-]*harness(\.exe)?$/.test(name) ||
|
||||
/^dsh[\s._-]*next(\.exe)?$/.test(name)
|
||||
) return true;
|
||||
if (pathLooksDesktop(execPath)) return true;
|
||||
|
||||
|
||||
Reference in new issue
Block a user