(patchFileName string)
| 292 | } |
| 293 | |
| 294 | func (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 | } |