Skip to content

Commit

Permalink
Remove trailing /. (#50)
Browse files Browse the repository at this point in the history
This typically happened when users used `--project-root`.
  • Loading branch information
floitsch authored Sep 28, 2023
1 parent 85991d7 commit 1be02ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/tpkg/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@ func (s *Spec) visitLocalDeps(ui UI, cb func(pkgPath string, fullPath string, de
}
}

// 'filepath.Rel' sometimes adds '/.' to the path, which we don't want.
// Generally, just remove any trailing '/.'.
slashDot := string(filepath.Separator) + "."
if pkgPath != slashDot {
pkgPath = strings.TrimSuffix(pkgPath, slashDot)
}

fullPath := pkgPath
if !filepath.IsAbs(fullPath) {
fullPath = filepath.Join(entryDir, fullPath)
Expand Down

0 comments on commit 1be02ac

Please sign in to comment.