refactor: extract set_db_vars and strip_template_block to lib/common.sh

Identical copies of _set_db_vars() and _strip_block() existed in
phase1, phase2, and phase8. Moved to lib/common.sh as set_db_vars()
and strip_template_block() (public API, no underscore prefix).
Removed dead _strip_block definition from phase8 (defined but never called).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
S
2026-03-01 11:39:20 -05:00
parent b573b77ab1
commit 8cf762c465
3 changed files with 12 additions and 101 deletions

View File

@@ -38,13 +38,6 @@ read -ra REPOS <<< "$REPO_NAMES"
PHASE8_STATE_DIR="$(_project_root)/.manifests"
PHASE8_STATE_FILE="${PHASE8_STATE_DIR}/phase8_github_repo_state.json"
# Strip conditional blocks from a rendered file.
_strip_block() {
local file="$1" start="$2" end="$3"
sed -i.bak "/${start}/,/${end}/d" "$file"
rm -f "${file}.bak"
}
# ---------------------------------------------------------------------------
# Helper: persist original GitHub repo settings for teardown symmetry
# ---------------------------------------------------------------------------