@@ -167,7 +167,13 @@ func (pp *Dfpp) Merge(merge bool, docs []string, include, exclude map[string]boo
167
167
details := strings .TrimPrefix (line , fields [0 ]+ " " )
168
168
169
169
if sref , ok := ops [op ]; merge && ok {
170
- if op == "ENV" || op == "LABEL" {
170
+ if op == "ENV" {
171
+ if ! strings .Contains (details , "=" ) {
172
+ fields := strings .Fields (details )
173
+ details = strings .Join (fields , "=" )
174
+ }
175
+ * sref += " \\ \n " + strings .Repeat (" " , len (op )+ 1 ) + details
176
+ } else if op == "LABEL" {
171
177
* sref += " \\ \n " + strings .Repeat (" " , len (op )+ 1 ) + details
172
178
} else if op == "RUN" {
173
179
* sref += " && \\ \n " + details
@@ -184,6 +190,12 @@ func (pp *Dfpp) Merge(merge bool, docs []string, include, exclude map[string]boo
184
190
result = append (result , & dup )
185
191
}
186
192
} else {
193
+ if op == "ENV" && ! strings .Contains (line , "=" ) {
194
+ line = strings .TrimPrefix (line , "ENV" )
195
+ line = strings .TrimSpace (line )
196
+ fields := strings .Fields (line )
197
+ line = fmt .Sprintf ("ENV %s" , strings .Join (fields , "=" ))
198
+ }
187
199
dup := string (line )
188
200
result = append (result , & dup )
189
201
ops [op ] = result [len (result )- 1 ]
0 commit comments