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

Method RemoveLogs

configs/port_remove.go:247–262  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245}
246
247func (p Port) RemoveLogs() error {
248 libraryDir := fmt.Sprintf("%s-%s-%s", p.ctx.Platform().GetName(), p.ctx.Project().GetName(), p.ctx.BuildType())
249 logPathPrefix := filepath.Join(p.NameVersion(), expr.If(p.DevDep || p.HostDep, p.ctx.Platform().GetHostName()+"-dev", libraryDir))
250 matches, err := filepath.Glob(filepath.Join(dirs.BuildtreesDir, logPathPrefix+"-*.log"))
251 if err != nil {
252 return fmt.Errorf("glob syntax error -> %w", err)
253 }
254
255 for _, match := range matches {
256 if err := os.Remove(match); err != nil {
257 return fmt.Errorf("failed to remove log %s -> %w", match, err)
258 }
259 }
260
261 return nil
262}

Callers 2

RemoveMethod · 0.95
doCleanMethod · 0.80

Calls 9

NameVersionMethod · 0.95
IfFunction · 0.92
SprintfMethod · 0.80
GetNameMethod · 0.65
PlatformMethod · 0.65
ProjectMethod · 0.65
BuildTypeMethod · 0.65
GetHostNameMethod · 0.65
RemoveMethod · 0.45

Tested by

no test coverage detected