refactor(cli): drop the redundant existence pre-check in resolveWindowsShellLayer

loadOverlayPatches already throws on a missing file (the caller named
it, so absence is a misconfiguration) — the existsSync guard was a
second fail-loud mechanism for the same miss with a prettier message.
The loader's throw keeps the fail-loud contract the Windows-default
note records.
This commit is contained in:
Huanqi Cao
2026-08-09 18:53:38 +08:00
parent 8af10a54b9
commit 63ad5d6d98
2 changed files with 6 additions and 7 deletions

View File

@@ -60,8 +60,10 @@ describe('resolveWindowsShellLayer', () => {
it('fails loud when the base bundle ships no Windows shell patch', () => {
const base = tempBase()
mkdirSync(base, { recursive: true })
// The overlay loader owns the fail-loud contract: the caller named this
// file, so its absence is a misconfiguration, not "no overlay".
expect(() => resolveWindowsShellLayer('win32', [fakeLayer(BASE_BUNDLE, base)], 'dsh'))
.toThrow(/@deepseek-ai\/dsh-base ships no windows\.cordis\.patch\.yml/)
.toThrow(/dsh: failed to read overlay .*windows\.cordis\.patch\.yml/)
})
})