fix(cli): resolve against cwd separately #1474
Merged
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.
Restore explicit proto filename resolution against
"."
removed in #1466. It was removed to facilitate proto filename resolution relative to cwd for file names that weren't prefixed with./
, but this ended up breaking it for those prefixed with./
. Instead of attempt to include"."
as an import path to resolve against alongside the CLI provided ones, we resolve against it afterwards. This is because theprotoparse.ResolveFilenames
will not resolve the file name if it is relative to any of the import paths, but we need it to in case the user provides a mix of import paths and cwd relative values. In this case, the prefix./
needs to be resolved as well.Tested it against both reported issue cases.
Updates #1471.