Skip to content

Conversation

tmr232
Copy link
Contributor

@tmr232 tmr232 commented May 8, 2025

Add support for Windows paths (paths with backwards slashes as path
separators).

This makes it easier to use Ratchet on Windows machines.

Add support for Windows paths (paths with backwards slashes as path
separators).

This makes it easier to use Ratchet on Windows machines.
@sethvargo sethvargo enabled auto-merge (squash) May 8, 2025 20:58
@sethvargo sethvargo requested a review from Copilot May 8, 2025 20:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Windows paths by normalizing file path inputs using filepath.Clean and filepath.ToSlash.

  • Replace TrimPrefix with a robust Windows-friendly path cleaning mechanism.
  • Improves cross-platform compatibility for file path resolution.
Comments suppressed due to low confidence (1)

command/command.go:155

  • Ensure that unit tests cover cases with Windows-style paths containing backslashes to prevent regression issues.
pth = filepath.ToSlash(filepath.Clean(pth))

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Seth Vargo <seth@sethvargo.com>
@sethvargo sethvargo disabled auto-merge May 8, 2025 21:00
@sethvargo sethvargo merged commit 7331817 into sethvargo:main May 8, 2025
3 checks passed
@tmr232
Copy link
Contributor Author

tmr232 commented May 9, 2025

Thanks for the super-quick response!

@tmr232 tmr232 deleted the windows-path-support branch May 9, 2025 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants