Expand description
Editor integration for bn edit command.
This module provides low-level file operations for editing beans:
- Launching an external editor subprocess
- Creating backups before editing
- Validating and saving edited content
- Rebuilding indices after modifications
- Prompting user for rollback on validation errors
Functions§
- cmd_
edit - Orchestrate the complete bn edit workflow for a bean.
- load_
backup - Load file content into memory as a backup before editing.
- open_
editor - Open a file in the user’s configured editor.
- prompt_
rollback - Prompt user for action when validation fails: retry, rollback, or abort.
- rebuild_
index_ after_ edit - Rebuild the bean index from current bean files on disk.
- validate_
and_ save - Validate bean content and persist it to disk with updated timestamp.