fix(infra): improve setup.sh publish error handling — distinguish real failures from 409 conflicts
This commit is contained in:
parent
85aca5534b
commit
c0bc13e10a
@ -363,12 +363,15 @@ phase5_publish() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
# Single publish attempt — "already exists" errors are expected and OK
|
# Single publish attempt — "already exists" (409) errors are expected and OK
|
||||||
if (cd "$pkg_dir" && pnpm publish --registry "$registry_url" --no-git-checks 2>&1); then
|
local pub_output
|
||||||
|
if pub_output=$(cd "$pkg_dir" && pnpm publish --registry "$registry_url" --no-git-checks 2>&1); then
|
||||||
|
published=$((published + 1))
|
||||||
|
elif echo "$pub_output" | grep -qi 'already exists\|409\|conflict'; then
|
||||||
published=$((published + 1))
|
published=$((published + 1))
|
||||||
else
|
else
|
||||||
# 409 Conflict (already published) is fine; real errors are rare
|
warn " Failed to publish ${pkg_name}: $(echo "$pub_output" | tail -1)"
|
||||||
published=$((published + 1))
|
skipped=$((skipped + 1))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user