Expand description
File operations for worktree-setup.
This crate provides file system operations for setting up worktrees:
- Symlink creation
- File and directory copying
- Configuration application
- Operation planning with file counts
§Example
ⓘ
use worktree_setup_operations::{plan_operations, execute_operation};
// Plan operations first (for progress display)
let operations = plan_operations(&config, &main_path, &target_path, &options)?;
// Execute each operation with progress callback
for op in &operations {
execute_operation(op, |completed, total| {
println!("{}/{} files", completed, total);
})?;
}Structs§
- Apply
Config Options - Options for applying a configuration.
- Apply
Result - Result of applying a configuration.
- Copy
Progress - Progress information for a copy operation.
- Operation
Record - Record of a single file operation.
- Planned
Operation - A planned operation with metadata for progress display.
Enums§
- Operation
Error - Errors that can occur during file operations.
- Operation
Result - Result of a single file operation.
- Operation
Type - Type of operation to perform.
Functions§
- apply_
config - Apply a loaded configuration to a target worktree.
- copy_
directory - Copy a directory recursively from source to target.
- copy_
directory_ with_ progress - Copy a directory recursively from source to target with progress callback.
- copy_
file - Copy a file from source to target.
- copy_
file_ with_ progress - Copy a file from source to target with progress callback.
- create_
symlink - Create a symlink from source to target.
- execute_
operation - Execute a single planned operation with progress callback.
- force_
create_ symlink - Create a symlink from source to target, optionally overwriting existing targets.
- overwrite_
file - Copy a file from source to target, overwriting if it exists.
- overwrite_
file_ with_ progress - Copy a file from source to target, overwriting if it exists, with progress callback.
- plan_
operations - Plan all operations for a config without executing.
- plan_
operations_ with_ progress - Plan all operations for a config with progress reporting.
- plan_
unstaged_ operations - Plan unstaged file operations.