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: make sure destination uses posix separator instead of win #2304

Merged
merged 5 commits into from
Oct 5, 2023

Conversation

ddelgrosso1
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #2301 🦕

@ddelgrosso1 ddelgrosso1 requested review from a team as code owners September 14, 2023 20:29
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: storage Issues related to the googleapis/nodejs-storage API. labels Sep 14, 2023
@ddelgrosso1 ddelgrosso1 added the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 14, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 14, 2023
@ddelgrosso1 ddelgrosso1 added the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 19, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 19, 2023
@@ -396,12 +396,14 @@ export class TransferManager {
...options.passthroughOptions,
};

passThroughOptionsCopy.destination = filePath;
passThroughOptionsCopy.destination = filePath
.split(path.win32.sep)
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps using the OS-specific path.sep would be preferred to prefer POSIX customers' ability to write with \.

Suggested change
.split(path.win32.sep)
.split(path.sep)

Comment on lines 404 to 406
.join(options.prefix, passThroughOptionsCopy.destination)
.split(path.win32.sep)
.join(path.posix.sep);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the prefix here should be split first to preserve the \ for POSIX (in case customers really want it)

Suggested change
.join(options.prefix, passThroughOptionsCopy.destination)
.split(path.win32.sep)
.join(path.posix.sep);
.posix.join(...options.prefix.split(path.sep), passThroughOptionsCopy.destination);

@ddelgrosso1 ddelgrosso1 force-pushed the fix-folder-path-win branch 2 times, most recently from 470aca5 to dc77605 Compare October 5, 2023 14:14
@ddelgrosso1 ddelgrosso1 added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 5, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 5, 2023
@ddelgrosso1 ddelgrosso1 merged commit 1d4ea74 into googleapis:main Oct 5, 2023
14 checks passed
@ddelgrosso1 ddelgrosso1 deleted the fix-folder-path-win branch October 5, 2023 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. size: s Pull request size is small.
Projects
None yet
2 participants