Skip to content

fix: Fix error when input file is on different drive on Windows#727

Open
MurakamiShinyu wants to merge 1 commit intomainfrom
fix/issue725
Open

fix: Fix error when input file is on different drive on Windows#727
MurakamiShinyu wants to merge 1 commit intomainfrom
fix/issue725

Conversation

@MurakamiShinyu
Copy link
Member

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

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`
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.

Error when input file is not in the current drive on Windows

1 participant