This repository was archived by the owner on Nov 18, 2026. It is now read-only.
Repository navigation
Conversation
`verify-dsh-022-adaptation.mjs` 直接读 `~/.dsh/profiles/web/...`,但 DSH 本身没有 "当前 profile"的概念:桌面版用 `desktop`,SDK 版用 `sdk`,老部署才是 `web`。 在这些机器上 `npm run verify:adaptation` 会直接 ENOENT 中断,一行断言都跑不到。 改动: - `scripts/dsh-modules.mjs` 新增 `dshProfileName()`:DSH_PROFILE → 唯一目录 → desktop → web → 无法确定(返回 name: null,由调用方决定报错还是跳过) - `verify-dsh-022-adaptation.mjs` 用它解析 profile,并在无法确定时用既有的 `skip()` 显式记为跳过(而不是抛出),输出里带上"目标 profile:xxx(为什么)" - 三条 profile 相关断言(patch 内容 / bundles / node_modules 链接)从写死路径改为 使用解析出的目录 保留旧行为:只有 `web` 的机器结果不变;显式设 DSH_PROFILE 仍然最高优先级。 验证:`dshProfileName()` 的 7 个分支用临时目录单测通过(desktop+sdk→desktop、 唯一目录、只有 web、web+devbox、歧义、目录不存在、DSH_PROFILE 覆盖)。 `node --check` 通过。 注:该脚本还要求能解析到 DSH 自身的模块(dev checkout 或 DSH_INSTALL_MODULES), 这是既有前提,本次未改动。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
scripts/verify-dsh-022-adaptation.mjs直接写死 profile 目录:但 DSH 本身没有"当前 profile"的概念:
desktopsdkweb在没有
web的机器上,npm run verify:adaptation会在第 204 行直接ENOENT中断,一行断言都跑不到——看起来像"脚本坏了",实际是路径假设不成立。
改动
1.
scripts/dsh-modules.mjs新增dshProfileName()和已有的
dshHome()/dshModulesDir()放在一起(同一类"反查本机 DSH 布局"的工具):顺序的理由:
DSH_PROFILE最高优先级——显式指定永远该生效;无法确定时返回
name: null+available,不抛异常,把决策权交给调用方。2.
verify-dsh-022-adaptation.mjs使用它无法确定时用既有的
skip()(脚本里已有这个"环境不允许断言就显式记为跳过"的约定),而不是抛错中断整个自检——后面的仓库侧断言(模型名、preset、守卫名单…)本来能跑。
测试
dshProfileName()的 7 个分支用临时目录单测(不依赖真实 DSH):node --check通过。范围说明
只改 profile 的解析方式,不动任何断言的语义。
与 #176 无关:那个改的是"安装器不再写 profile patch",本 PR 只修"自检脚本读错目录",
两者可以各自独立合并。