Skip to content

Commit

Permalink
Merge pull request #126 from motemen/abs-roots
Browse files Browse the repository at this point in the history
canonicalize root paths to absolute
  • Loading branch information
Songmu authored Apr 27, 2019
2 parents 630a457 + 954ee8e commit 6db039a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions local_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,15 @@ func localRepositoryRoots() []string {
for i, v := range _localRepositoryRoots {
path := filepath.Clean(v)
if _, err := os.Stat(path); err == nil {
_localRepositoryRoots[i], err = filepath.EvalSymlinks(path)
path, err = filepath.EvalSymlinks(path)
logger.PanicIf(err)
} else {
_localRepositoryRoots[i] = path
}
if !filepath.IsAbs(path) {
var err error
path, err = filepath.Abs(path)
logger.PanicIf(err)
}
_localRepositoryRoots[i] = path
}

return _localRepositoryRoots
Expand Down

0 comments on commit 6db039a

Please sign in to comment.