fix: STATE.md entries without status prefix — reads as done once merged
This commit is contained in:
parent
a3f0f7f6f3
commit
2b3c488f1c
1 changed files with 4 additions and 5 deletions
|
|
@ -93,21 +93,20 @@ trap cleanup EXIT
|
||||||
|
|
||||||
# STATE.MD helpers (must be defined before use at worktree setup)
|
# STATE.MD helpers (must be defined before use at worktree setup)
|
||||||
write_state_entry() {
|
write_state_entry() {
|
||||||
local status_word="${1:-in-progress}"
|
|
||||||
local target="${WORKTREE:-$REPO_ROOT}"
|
local target="${WORKTREE:-$REPO_ROOT}"
|
||||||
local state_file="${target}/STATE.md"
|
local state_file="${target}/STATE.md"
|
||||||
local today
|
local today
|
||||||
today=$(date -u +%Y-%m-%d)
|
today=$(date -u +%Y-%m-%d)
|
||||||
local description
|
local description
|
||||||
description=$(echo "$ISSUE_TITLE" | sed 's/^feat:\s*//i;s/^fix:\s*//i;s/^refactor:\s*//i')
|
description=$(echo "$ISSUE_TITLE" | sed 's/^feat:\s*//i;s/^fix:\s*//i;s/^refactor:\s*//i')
|
||||||
local line="- [${today}] [${status_word}] ${description} (#${ISSUE})"
|
local line="- [${today}] ${description} (#${ISSUE})"
|
||||||
if [ ! -f "$state_file" ]; then
|
if [ ! -f "$state_file" ]; then
|
||||||
printf '# STATE.md — What harb currently is and does\n\n' > "$state_file"
|
printf '# STATE.md — What harb currently is and does\n\n' > "$state_file"
|
||||||
fi
|
fi
|
||||||
echo "$line" >> "$state_file"
|
echo "$line" >> "$state_file"
|
||||||
log "STATE.md: ${line}"
|
log "STATE.md: ${line}"
|
||||||
}
|
}
|
||||||
append_state_log() { write_state_entry "done"; }
|
append_state_log() { write_state_entry; }
|
||||||
|
|
||||||
# --- Log rotation ---
|
# --- Log rotation ---
|
||||||
if [ -f "$LOGFILE" ] && [ "$(stat -c%s "$LOGFILE" 2>/dev/null || echo 0)" -gt 102400 ]; then
|
if [ -f "$LOGFILE" ] && [ "$(stat -c%s "$LOGFILE" 2>/dev/null || echo 0)" -gt 102400 ]; then
|
||||||
|
|
@ -564,8 +563,8 @@ else
|
||||||
git checkout -B "$BRANCH" origin/master 2>/dev/null
|
git checkout -B "$BRANCH" origin/master 2>/dev/null
|
||||||
git submodule update --init --recursive 2>/dev/null || true
|
git submodule update --init --recursive 2>/dev/null || true
|
||||||
|
|
||||||
# Write STATE.md entry — will be included in the first commit
|
# Write STATE.md entry — included in the first commit, reads as done once PR merges
|
||||||
write_state_entry "in-progress"
|
write_state_entry
|
||||||
|
|
||||||
# Symlink lib node_modules from main repo (submodule init doesn't run npm install)
|
# Symlink lib node_modules from main repo (submodule init doesn't run npm install)
|
||||||
for lib_dir in "$REPO_ROOT"/onchain/lib/*/; do
|
for lib_dir in "$REPO_ROOT"/onchain/lib/*/; do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue