hashFile adds the contents of a file to the given hash, prefixed by its path for domain separation.
(h io.Writer, path string)
| 202 | // hashFile adds the contents of a file to the given hash, prefixed by its path |
| 203 | // for domain separation. |
| 204 | func hashFile(h io.Writer, path string) error { |
| 205 | fmt.Fprintf(h, "file:%s\n", path) |
| 206 | |
| 207 | f, err := os.Open(path) |
| 208 | if err != nil { |
| 209 | return err |
| 210 | } |
| 211 | defer f.Close() |
| 212 | |
| 213 | _, err = io.Copy(h, f) |
| 214 | return err |
| 215 | } |
| 216 | |
| 217 | // buildTaskBundleImage runs `make task-bundle` for each version of the Task in |
| 218 | // the `$REPOSITORY_ROOT/task` directory to push the Tekton Task bundle to the |
no test coverage detected