buf icon indicating copy to clipboard operation
buf copied to clipboard

Return a more user-friendly error in workspace targeting for overlaps

Open doriable opened this issue 1 year ago • 1 comments

In the past, if the an overlap is found between moduleDirPath and inputPath, but inputPath does not exist (e.g. moduleDirPath == "." and inputPath == "fake-path") then it would return the error:

failed to build input "fake-path" because it is contained by module at path "." specified in your configuration, you must provide the workspace or module as the input, and filter to this path using --path"

Which isn't particularly clear, since fake-path doesn't exist. Added a check to return a nicer error to the user by checking inputPath. Also included test cases for v1 and v2 workspaces.

doriable avatar May 16 '24 00:05 doriable

Let's punt this until after the release

bufdev avatar May 16 '24 16:05 bufdev