add support for excludes in input dir
This adds support for `--include` and `--exclude` for directory inputs. For instance, this is what you would want to use when passing dagger repository as an input: ``` inputs: repository: dir: path: . exclude: - '**/node_modules' - cmd/dagger/dagger - cmd/dagger/dagger-debug ``` Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
41
tests/compute/exclude/.dagger/env/default/plan/main.cue
vendored
Normal file
41
tests/compute/exclude/.dagger/env/default/plan/main.cue
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/alpine"
|
||||
"dagger.io/dagger"
|
||||
"dagger.io/dagger/op"
|
||||
)
|
||||
|
||||
TestData: dagger.#Artifact
|
||||
|
||||
_expected: """
|
||||
/src/b.txt
|
||||
|
||||
/src/foo:
|
||||
bar.txt
|
||||
|
||||
"""
|
||||
|
||||
TestIgnore: {
|
||||
string
|
||||
#up: [
|
||||
op.#Load & {from: alpine.#Image},
|
||||
op.#Exec & {
|
||||
args: ["sh", "-c", "ls /src/* > /out.txt"]
|
||||
mount: "/src": from: TestData
|
||||
},
|
||||
op.#Export & {source: "/out.txt"},
|
||||
op.#Exec & {
|
||||
args: [
|
||||
"sh",
|
||||
"-ec",
|
||||
"""
|
||||
cat > /test.txt << EOF
|
||||
\(_expected)
|
||||
EOF
|
||||
test "$(cat /out.txt)" = "$(cat /test.txt)"
|
||||
""",
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user