fix: Fix error when input file is on different drive on Windows#727
Open
MurakamiShinyu wants to merge 1 commit intomainfrom
Open
fix: Fix error when input file is on different drive on Windows#727MurakamiShinyu wants to merge 1 commit intomainfrom
MurakamiShinyu wants to merge 1 commit intomainfrom
Conversation
Fixes #725. On Windows, when the input file is on a different drive than the current working directory (e.g., running from D: with input on C:), the CLI would fail with a confusing error about overwriting the working directory. This was caused by two issues: 1. `pathContains()` incorrectly returned true when comparing paths on different drives, because `upath.relative()` returns an absolute path in such cases. 2. `getSourceUrl()` tried to compute a relative path for webbook inputs that already had a URL path format. Changes: - Fix `pathContains()` to check if the relative path is absolute (indicating different drives) and return false in that case - Fix `getSourceUrl()` to use `webbookEntryUrl` directly as a URL path instead of computing a relative path from `workspaceDir`
aa1bba6 to
dea7ddf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #725.
On Windows, when the input file is on a different drive than the current working directory (e.g., running from D: with input on C:), the CLI would fail with a confusing error about overwriting the working directory.
This was caused by two issues:
pathContains()incorrectly returned true when comparing paths on different drives, becauseupath.relative()returns an absolute pathin such cases.
getSourceUrl()tried to compute a relative path for webbook inputs that already had a URL path format.Changes:
pathContains()to check if the relative path is absolute(indicating different drives) and return false in that case
getSourceUrl()to usewebbookEntryUrldirectly as a URL path instead of computing a relative path fromworkspaceDir