Skip to content

Commit

Permalink
fix: Calculate the correct relative target path even when the cwd is …
Browse files Browse the repository at this point in the history
…symlink
  • Loading branch information
yoheimuta committed Nov 21, 2020
1 parent 4a1b88f commit 84c57fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/linter/file/protoSet.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func collectAllProtoFilesFromArgs(
if err != nil {
return nil, err
}
// Eval a possible symlink for the cwd to calculate the correct relative paths in the next step.
if newPath, err := filepath.EvalSymlinks(absCwd); err == nil {
absCwd = newPath
}

var fs []ProtoFile
for _, path := range targetPaths {
Expand Down

0 comments on commit 84c57fd

Please sign in to comment.