Skip to content

Commit a6a7b95

Browse files
authored
Merge pull request #108 from hinshun/heredoc-customname
Remove new lines in vertex name for heredocs
2 parents 2df0011 + fa61f45 commit a6a7b95

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

codegen/chain.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"os"
7+
"strings"
78

89
shellquote "github.com/kballard/go-shellquote"
910
"github.com/moby/buildkit/client/llb"
@@ -326,7 +327,9 @@ func (cg *CodeGen) EmitFilesystemBuiltinChainStmt(ctx context.Context, scope *pa
326327
}
327328
}
328329

329-
opts = append(opts, llb.Shlex(shlex))
330+
customName := strings.ReplaceAll(shlex, "\n", "")
331+
opts = append(opts, llb.Shlex(shlex), llb.WithCustomName(customName))
332+
330333
fc = func(st llb.State) (llb.State, error) {
331334
exec := st.Run(opts...)
332335

0 commit comments

Comments
 (0)