(dir, name string, data []byte)
| 387 | } |
| 388 | |
| 389 | func writeManifest(dir, name string, data []byte) (writeErr error) { |
| 390 | path := filepath.Join(dir, name) |
| 391 | var f *os.File |
| 392 | if f, writeErr = os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600); writeErr != nil { |
| 393 | writeErr = fmt.Errorf("failed to open manifest for writing: %w", writeErr) |
| 394 | return |
| 395 | } |
| 396 | defer func() { |
| 397 | if err := f.Close(); writeErr == nil && err != nil { |
| 398 | writeErr = err |
| 399 | } |
| 400 | }() |
| 401 | if _, writeErr = f.Write(data); writeErr != nil { |
| 402 | writeErr = fmt.Errorf("failed write manifest file: %w", writeErr) |
| 403 | } |
| 404 | return |
| 405 | } |
| 406 | |
| 407 | func (m *Manager) installGit(repo ghrepo.Interface, target string) error { |
| 408 | protocol := m.config.GitProtocol(repo.RepoHost()).Value |
no test coverage detected