Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/rename-collection-support-wsl #2892

Merged

Conversation

Pragadesh-45
Copy link
Contributor

@Pragadesh-45 Pragadesh-45 commented Aug 22, 2024

Fixes: #2342 #2269

There was an error which was thrown due to path normalization issues with WSL paths (When we try to rename requests). The error observed was:

Error invoking remote method 'renderer:rename-item': Error: ENOENT: no such file or directory, open 'C:\wsl.localhost\Ubuntu\home\User\open-bruno\packages\bruno-tests\collection\ping_.bru'

Changes

  • Added a function to normalize WSL paths to Windows UNC paths to handle the issue:
function normalizePath(pathname) {
  // Convert WSL path to Windows UNC path
  return pathname.replace(/^\/wsl.localhost/, '\\\\wsl.localhost').replace(/\//g, '\\');
}

Contribution Checklist

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes.
  • I have added screenshots or gifs to help explain the change if applicable.

Before:
image

After:
The issue is resolved, and I can successfully change the name of the request without encountering the path error.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Aug 22, 2024
@helloanoop helloanoop merged commit 0b9554c into usebruno:main Aug 23, 2024
2 checks passed
@Pragadesh-45 Pragadesh-45 deleted the fix/rename-collection-support-wsl branch August 23, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't rename request from Bruno Windows on WSL .bru files
2 participants