pub fn apply_update(target_dir: &Path) -> Result<ApplyResult, ApplyError>Expand description
Apply rust-bucket to a target directory in update mode (subsequent runs).
This function implements the subsequent-times flow as specified in ARCHITECTURE.md:
- Assert Cargo.toml exists (this is a Rust crate)
- Assert .git/ exists (git init was done)
- Load rust-bucket.toml using Config::load()
- Validate config (log/warn if version is different)
- Pre-populate choices from config (test_timeout already set)
- Prompt for any NEW choices not in config (none in v1, so skip)
- Update config’s rust_bucket_version to current version
- Write updated rust-bucket.toml using config.save()
- Extract templates to temp dir using templates::extract_to_temp()
- Render templates to target dir using generator::render() with overwrite=true
- Run verification using verify::run_all()
- Return result
§Arguments
target_dir- The target directory to update rust-bucket files in
§Errors
Returns ApplyError if:
- The target is not a Rust crate (no Cargo.toml)
- The target is not a git repository (no .git/)
- The rust-bucket.toml config file cannot be loaded
- Any step in the process fails (config save, template extraction, rendering, verification)