Repository navigation
fix(issue-13): homedir()/.dsh 硬编码——优先读取 DSH_HOME 环境变量 (closes #13) - #19
Merged
Merged
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
closes #13
改动(4 文件,+52/-5)
src/config.js:新增导出resolveDshRoot(env)—— 优先process.env.DSH_HOME(非空字符串时采用,trim 后作为根),未设置/空回退homedir()/.dsh;单测可经 env 注入,不污染进程全局环境src/model-provider.js:profile 路由根profilesRoot改为join(resolveDshRoot(), 'profiles')(仅路径来源变更,路由解析逻辑不动)src/credentials.js:凭据文件路径改为join(resolveDshRoot(), '.credentials.yaml')(仅路径来源变更,凭据读取逻辑不动)scripts/unit-smoke.mjs:新增resolveDshRoot用例(6 条断言:DSH_HOME 采用 / trim / 未设置回退 / 空串回退 / 纯空白回退 / 无参自洽)验证输出(最小运行验证:临时 DSH_HOME + 最小 profile + 凭据文件)
测试
npm run check:零报错npm run unit:unit-smoke 45 项全绿(含新增resolveDshRoot:优先 DSH_HOME,未设置回退 homedir()/.dsh(issue #13))+ file-config 16 项全绿