Merge pull request #14 from returntocorp/mj-copy-multiple-files

Allow copying multiple files with ADD/COPY
This commit is contained in:
Camden Cheek 2022-01-27 11:14:35 -07:00 committed by GitHub
commit 4e5f9a0a61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 3526 additions and 3436 deletions

View file

@ -25,3 +25,16 @@ ADD --chown=a:b /src ./dst
(path) (path)
(path))) (path)))
==================
Multiple files
==================
ADD src1 src2 dst
---
(source_file
(add_instruction
(path)
(path)
(path)))

View file

@ -25,3 +25,16 @@ COPY --chown=a:b /src ./dst
(path) (path)
(path))) (path)))
==================
Multiple files
==================
COPY src1 src2 dst
---
(source_file
(copy_instruction
(path)
(path)
(path)))

View file

@ -68,8 +68,9 @@ module.exports = grammar({
seq( seq(
alias(/[aA][dD][dD]/, "ADD"), alias(/[aA][dD][dD]/, "ADD"),
optional($.param), optional($.param),
$.path, repeat1(
$._non_newline_whitespace, seq($.path, $._non_newline_whitespace)
),
$.path $.path
), ),
@ -77,8 +78,9 @@ module.exports = grammar({
seq( seq(
alias(/[cC][oO][pP][yY]/, "COPY"), alias(/[cC][oO][pP][yY]/, "COPY"),
optional($.param), optional($.param),
$.path, repeat1(
$._non_newline_whitespace, seq($.path, $._non_newline_whitespace)
),
$.path $.path
), ),

View file

@ -332,12 +332,20 @@
] ]
}, },
{ {
"type": "SYMBOL", "type": "REPEAT1",
"name": "path" "content": {
}, "type": "SEQ",
{ "members": [
"type": "SYMBOL", {
"name": "_non_newline_whitespace" "type": "SYMBOL",
"name": "path"
},
{
"type": "SYMBOL",
"name": "_non_newline_whitespace"
}
]
}
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",
@ -370,12 +378,20 @@
] ]
}, },
{ {
"type": "SYMBOL", "type": "REPEAT1",
"name": "path" "content": {
}, "type": "SEQ",
{ "members": [
"type": "SYMBOL", {
"name": "_non_newline_whitespace" "type": "SYMBOL",
"name": "path"
},
{
"type": "SYMBOL",
"name": "_non_newline_whitespace"
}
]
}
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",

File diff suppressed because it is too large Load diff