mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
builder: strip blank lines before processing any line continuations.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
parent
dc243c812b
commit
a1ef2207dd
3 changed files with 11 additions and 0 deletions
|
@ -98,6 +98,10 @@ func Parse(rwc io.Reader) (*Node, error) {
|
||||||
scanner := bufio.NewScanner(rwc)
|
scanner := bufio.NewScanner(rwc)
|
||||||
|
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
|
if scanner.Text() == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
line, child, err := parseLine(strings.TrimLeftFunc(scanner.Text(), unicode.IsSpace))
|
line, child, err := parseLine(strings.TrimLeftFunc(scanner.Text(), unicode.IsSpace))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -5,4 +5,10 @@ RUN apt-get \update && \
|
||||||
apt-get \"install znc -y
|
apt-get \"install znc -y
|
||||||
ADD \conf\\" /.znc
|
ADD \conf\\" /.znc
|
||||||
|
|
||||||
|
RUN foo \
|
||||||
|
|
||||||
|
bar \
|
||||||
|
|
||||||
|
baz
|
||||||
|
|
||||||
CMD [ "\/usr\\\"/bin/znc", "-f", "-r" ]
|
CMD [ "\/usr\\\"/bin/znc", "-f", "-r" ]
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
(maintainer "Erik \\\\Hollensbe <erik@hollensbe.org>\\\"")
|
(maintainer "Erik \\\\Hollensbe <erik@hollensbe.org>\\\"")
|
||||||
(run "apt-get \\update && apt-get \\\"install znc -y")
|
(run "apt-get \\update && apt-get \\\"install znc -y")
|
||||||
(add "\\conf\\\\\"" "/.znc")
|
(add "\\conf\\\\\"" "/.znc")
|
||||||
|
(run "foo bar baz")
|
||||||
(cmd "/usr\\\"/bin/znc" "-f" "-r")
|
(cmd "/usr\\\"/bin/znc" "-f" "-r")
|
||||||
|
|
Loading…
Reference in a new issue