Skip to main content

Crate worktree_setup_operations

Crate worktree_setup_operations 

Source
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§

ApplyConfigOptions
Options for applying a configuration.
ApplyResult
Result of applying a configuration.
CopyProgress
Progress information for a copy operation.
OperationRecord
Record of a single file operation.
PlannedOperation
A planned operation with metadata for progress display.

Enums§

OperationError
Errors that can occur during file operations.
OperationResult
Result of a single file operation.
OperationType
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.