blob: 762509cf794ecd8aaa5b05e02fd4719dc93393ba [file] [log] [blame]
cue cmd before
cmp stdout expect-stdout
-- expect-stdout --
true
-- before_tool.cue --
package home
import (
"tool/exec"
"tool/cli"
"strings"
)
command: before: {
task: {
t1: exec.Run & {
cmd: ["sh", "-c", "sleep 2; date +%s"]
stdout: string
$before: [task.t2, task.t3]
}
t2: exec.Run & {
cmd: ["sh", "-c", "date +%s"]
stdout: string
$before: task.t4
}
t3: exec.Run & {
cmd: ["sh", "-c", "date +%s"]
stdout: string
}
t4: exec.Run & {
cmd: ["sh", "-c", "a=\(strings.TrimSpace(task.t1.stdout));b=\(strings.TrimSpace(task.t2.stdout));if [ $a -le $b ]; then echo 'true'; fi"]
stdout: string
}
t5: cli.Print & {
text: task.t4.stdout
}
}
}
-- task.cue --
package home
-- cue.mod --