MCPcopy Create free account
hub / github.com/celer-pkg/celer / Exist

Method Exist

pkgcache/cache_artifact.go:199–207  ·  view source on GitHub ↗

Exist check both archive file and build desc file exist.

(nameVersion, hash string)

Source from the content-addressed store, hash-verified

197
198// Exist check both archive file and build desc file exist.
199func (a ArtifactConfig) Exist(nameVersion, hash string) bool {
200 platformName := a.ctx.Platform().GetName()
201 projectName := a.ctx.Project().GetName()
202 buildType := a.ctx.BuildType()
203 artifactCacheDir := a.ctx.PkgCacheConfig().GetDir(context.PkgCacheDirArtifacts)
204 archivePath := filepath.Join(artifactCacheDir, platformName, projectName, buildType, nameVersion, hash+".tar.gz")
205 metaFilePath := filepath.Join(artifactCacheDir, platformName, projectName, buildType, nameVersion, "metas", hash+".meta")
206 return fileio.PathExists(archivePath) && fileio.PathExists(metaFilePath)
207}

Callers

nothing calls this directly

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