63b48736ed
This PR splits the entrypoint bin in to separate files for the Runner, Waiter and PostWriter types. This is done because we're going to need to modify the Runner while adding logging and I want to merge the refactoring noise separate from the logic changes.
23 lines
377 B
Go
23 lines
377 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/tektoncd/pipeline/pkg/entrypoint"
|
|
)
|
|
|
|
// RealPostWriter actually writes files.
|
|
type RealPostWriter struct{}
|
|
|
|
var _ entrypoint.PostWriter = (*RealPostWriter)(nil)
|
|
|
|
func (*RealPostWriter) Write(file string) {
|
|
if file == "" {
|
|
return
|
|
}
|
|
if _, err := os.Create(file); err != nil {
|
|
log.Fatalf("Creating %q: %v", file, err)
|
|
}
|
|
}
|