diff --git a/internal/buildfile/reader.go b/internal/buildfile/reader.go index 28c727d..c2811ba 100644 --- a/internal/buildfile/reader.go +++ b/internal/buildfile/reader.go @@ -37,13 +37,22 @@ func NewReader(ctx *instruction.ExecutionContext, buildfile io.Reader) (*Reader, // add each line as instruction l, reader := 0, bufio.NewReader(buildfile) + eof := false for { + if eof { + break + } + l++ // read line until end line, err := reader.ReadString('\n') if err == io.EOF { - break + if len(line) > 0 { + eof = true + } else { + break + } } else if err != nil { return nil, LineError{l, err} }