Skip to content
Prev Previous commit
Next Next commit
fix: split awk && mv to let set -e catch awk failures
Under set -e, the left side of && does not trigger errexit on failure.
Split into two statements so awk failures are fatal instead of silent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  • Loading branch information
Bo Bobson and claude committed Apr 7, 2026
commit 414d01692f35fec313e861bce7349083459e2dca
3 changes: 2 additions & 1 deletion scripts/bash/update-agent-context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ create_new_agent_file() {
done

# Convert literal \n sequences to actual newlines (portable — works on BSD + GNU)
awk '{gsub(/\\n/,"\n")}1' "$temp_file" > "$temp_file.tmp" && mv "$temp_file.tmp" "$temp_file"
awk '{gsub(/\\n/,"\n")}1' "$temp_file" > "$temp_file.tmp"
mv "$temp_file.tmp" "$temp_file"

# Clean up backup files from sed -i.bak
rm -f "$temp_file.bak"
Expand Down