{do:"subdir"} to select a subdirectory in a script
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
29
tests/subdir/simple/main.cue
Normal file
29
tests/subdir/simple/main.cue
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
hello: {
|
||||
string
|
||||
|
||||
#dagger: compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["mkdir", "-p", "/tmp/foo"]
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["sh", "-c", "echo -n world > /tmp/foo/hello"]
|
||||
},
|
||||
{
|
||||
do: "subdir"
|
||||
dir: "/tmp/foo"
|
||||
},
|
||||
{
|
||||
do: "export"
|
||||
source: "/hello"
|
||||
format: "string"
|
||||
},
|
||||
]
|
||||
}
|
@@ -217,6 +217,11 @@ test::input() {
|
||||
}
|
||||
|
||||
|
||||
test::subdir() {
|
||||
test::one "Subdir: simple usage" --exit=0 --stdout='{"hello":"world"}' \
|
||||
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/subdir/simple
|
||||
}
|
||||
|
||||
test::all(){
|
||||
local dagger="$1"
|
||||
|
||||
@@ -231,6 +236,7 @@ test::all(){
|
||||
test::exec "$dagger"
|
||||
test::export "$dagger"
|
||||
test::input "$dagger"
|
||||
test::subdir "$dagger"
|
||||
}
|
||||
|
||||
case "${1:-all}" in
|
||||
|
Reference in New Issue
Block a user