fix: add Darwin platform support and fix Windows test failures#380
fix: add Darwin platform support and fix Windows test failures#380nicholas-fedor merged 1 commit intomainfrom
Conversation
- Add trash_darwin.go with macOS XDG Trash implementation - Update isSupportedPlatform() to include Darwin in buildinfo - Move generateUniqueName() to common trash.go for cross-platform access - Fix storage test to use empty string for invalid path validation - Update error messages to reflect Darwin platform support
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis pull request adds Darwin/macOS platform support for file trash operations and updates platform detection. A reusable timestamp-based unique naming utility is extracted to a shared module, enabling its use in both Linux and Darwin implementations. A comprehensive Darwin-specific trash handler is introduced alongside platform support expansion in the buildinfo module. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant Trash as Trash System
participant FS as Filesystem
participant Meta as Metadata (.trashinfo)
rect rgba(100, 150, 200, 0.5)
note over App,Meta: MoveToTrash Flow (Darwin)
App->>Trash: MoveToTrash(filePath)
Trash->>Trash: generateUniqueName(filename)
Trash->>FS: Move file to trash directory
alt Cross-device move fails
Trash->>FS: Copy file to trash
Trash->>FS: Delete original file
end
Trash->>Meta: Create .trashinfo metadata
Trash-->>App: Success/Error
end
rect rgba(150, 200, 100, 0.5)
note over App,Meta: Restore Flow (Darwin)
App->>Trash: Restore(trashPath, originalPath)
Trash->>Meta: Read .trashinfo metadata
Trash->>FS: Check for collision at original location
Trash->>FS: Create parent directories if needed
Trash->>FS: Restore file to original location
alt Cross-device restore fails
Trash->>FS: Copy file from trash
Trash->>FS: Delete from trash
end
Trash->>Meta: Remove .trashinfo metadata
Trash-->>App: Success/Error
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add cross-platform support for Darwin (macOS) and fix Windows-specific test failures.
Problem
CI tests were failing on Darwin (macOS) and Windows platforms due to:
undefined: newTrasher)generateUniqueNamenot accessible on WindowsSolution
Changes
generateUniqueName()for cross-platform accessgenerateUniqueName()functionisSupportedPlatform()and updated error messageSummary by CodeRabbit
Release Notes
New Features
Tests