Skip to content

Commit

Permalink
fix: update cache path after the latest version fetched (#528)
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe authored Nov 8, 2024
1 parent 9be5761 commit 70859ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/visitor/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,23 @@ func (rv *RemoteVisitor) Visit(s *downloader.Source, v visitFunc) error {

// Generate the local path for the remote package after the version is specified.
if ok, err := features.Enabled(features.SupportNewStorage); err == nil && !ok {
// update the local module path with the latest version.
if len(rv.VisitedSpace) != 0 {
modFullPath = s.LocalPath(rv.VisitedSpace)
}
// update the cache path with the latest version.
if rv.EnableCache {
cacheFullPath = s.CachePath(rv.CachePath)
}
} else {
// update the local module path with the latest version.
if len(rv.VisitedSpace) != 0 {
modFullPath = s.LocalPath(filepath.Join(rv.VisitedSpace, s.Type(), "src"))
}
// update the cache path with the latest version.
if rv.EnableCache {
cacheFullPath = s.CachePath(filepath.Join(rv.CachePath, s.Type(), "cache"))
}
}

if len(rv.VisitedSpace) == 0 {
Expand Down

0 comments on commit 70859ab

Please sign in to comment.