diff --git a/projects/-Users-csader/memory/MEMORY.md b/projects/-Users-csader/memory/MEMORY.md index 8fa9ea0..c9deaf2 100644 --- a/projects/-Users-csader/memory/MEMORY.md +++ b/projects/-Users-csader/memory/MEMORY.md @@ -14,3 +14,4 @@ - [HACS and Mushroom on HA Blue](reference_hacs_mushroom.md) — HACS, Mushroom, weatheralerts install details - [Never use "new" as automation ID](feedback_automation_ids.md) — Use unique numeric IDs when creating automations via REST API - [Claude Code sync setup](reference_claude_sync.md) — Cross-machine sync via Gitea repo, LaunchAgents, memory symlinks between MacBook Pro and claude-code.local +- [No sed for multi-line edits](feedback_no_sed_multiline.md) — Use Python or heredoc writes for multi-line config inserts, not sed diff --git a/projects/-Users-csader/memory/feedback_no_sed_multiline.md b/projects/-Users-csader/memory/feedback_no_sed_multiline.md new file mode 100644 index 0000000..d38f7d6 --- /dev/null +++ b/projects/-Users-csader/memory/feedback_no_sed_multiline.md @@ -0,0 +1,14 @@ +--- +name: feedback-no-sed-multiline +description: Never use sed for multi-line config edits — use Python or heredoc writes to avoid mangling YAML/config files +metadata: + node_type: memory + type: feedback + originSessionId: d51db7ad-b5b8-40f4-b56a-9585fd13b303 +--- + +Do not use `sed -i` for inserting multi-line blocks into config files (YAML, TOML, etc.). The newline handling breaks formatting and causes service outages. + +**Why:** sed collapsed a multi-line OIDC client block into a single line, breaking Authelia's configuration.yml and causing a crash loop. + +**How to apply:** For any config file edit that spans multiple lines, use Python (read/replace/write) or `tee` with a heredoc. Only use sed for single-line substitutions where the replacement fits on one line. Related: [[feedback-caddyfile-inode]]