MCPcopy Index your code
hub / github.com/celer-pkg/celer / Remove

Method Remove

pkgcache/cache_artifact.go:183–196  ·  view source on GitHub ↗

Remove removes the cache for the specified platform, project, build type and name version.

(nameVersion string)

Source from the content-addressed store, hash-verified

181
182// Remove removes the cache for the specified platform, project, build type and name version.
183func (a ArtifactConfig) Remove(nameVersion string) error {
184 platformName := a.ctx.Platform().GetName()
185 projectName := a.ctx.Project().GetName()
186 buildType := a.ctx.BuildType()
187 artifactCacheDir := a.ctx.PkgCacheConfig().GetDir(context.PkgCacheDirArtifacts)
188 pacakgeDir := filepath.Join(artifactCacheDir, platformName, projectName, buildType, nameVersion)
189 if fileio.PathExists(pacakgeDir) {
190 if err := os.RemoveAll(pacakgeDir); err != nil {
191 return fmt.Errorf("failed toremove cache package %s -> %w", pacakgeDir, err)
192 }
193 }
194
195 return nil
196}
197
198// Exist check both archive file and build desc file exist.
199func (a ArtifactConfig) Exist(nameVersion, hash string) bool {

Callers 1

StoreMethod · 0.45

Calls 7

PathExistsFunction · 0.92
GetNameMethod · 0.65
PlatformMethod · 0.65
ProjectMethod · 0.65
BuildTypeMethod · 0.65
GetDirMethod · 0.65
PkgCacheConfigMethod · 0.65

Tested by

no test coverage detected