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

Method readPatch

pkgcache/metadata.go:294–306  ·  view source on GitHub ↗
(patchFileName string)

Source from the content-addressed store, hash-verified

292}
293
294func (p Port) readPatch(patchFileName string) (string, error) {
295 patchFilePath := filepath.Join(filepath.Dir(p.BuildConfig.PortFile), patchFileName)
296 if !fileio.PathExists(patchFilePath) {
297 return "", fmt.Errorf("patch %s not found", patchFileName)
298 }
299
300 bytes, err := os.ReadFile(patchFilePath)
301 if err != nil {
302 return "", fmt.Errorf("read patch %s: %s", patchFilePath, err)
303 }
304
305 return string(bytes), nil
306}

Callers 1

buildMetaMethod · 0.95

Calls 1

PathExistsFunction · 0.92

Tested by

no test coverage detected