fix(dsh): O-2 — WARN и в install_global, ассерты артефактов (#62)

This commit is contained in:
Andrey Epifancev 2026-10-25 12:29:30 +04:00
parent 183f8d8956
commit 6800550cd5
2 changed files with 16 additions and 0 deletions

View File

@ -372,6 +372,7 @@ check() {
}
install_global() {
warn_mixed_dsh_home
mkdir -p "$DSH_HOME"
local target="$DSH_HOME/AGENTS.md"
if [ -f "$target" ]; then

View File

@ -666,6 +666,21 @@ test('--skills and --roles warn when DSH_HOME exists while HOME is isolated (O-2
const rolesOut = roles.stdout + roles.stderr
assert.equal(roles.status, 0, rolesOut)
assert.ok(rolesOut.includes(warn), rolesOut)
assert.ok(existsSync(join(sharedDsh, 'roles', 'dev.md')), 'roles land in the warned DSH_HOME')
// --global overwrites AGENTS.md (after a backup): the destructive step must
// warn too (T3.1).
const global = runInstaller(home, ['--global'], { DSH_HOME: sharedDsh })
const globalOut = global.stdout + global.stderr
assert.equal(global.status, 0, globalOut)
assert.ok(globalOut.includes(warn), globalOut)
assert.ok(existsSync(join(sharedDsh, 'AGENTS.md')), 'AGENTS.md is installed after the warning')
// One run touching several steps warns exactly once (T3.2).
const combined = runInstaller(home, ['--skills', '--roles', '--superpowers-from', src], { DSH_HOME: sharedDsh })
const combinedOut = combined.stdout + combined.stderr
assert.equal(combined.status, 0, combinedOut)
assert.equal((combinedOut.match(/WARN: DSH_HOME=/g) ?? []).length, 1, combinedOut)
// Isolated together ($DSH_HOME=$HOME/.dsh): no warning.
const normal = runInstaller(home, ['--skills', '--superpowers-from', src])