engine: Fix up some send/recv corner cases
Initially I wasn't 100% clear or decided on the send/recv semantics. After some experimenting, I think this is much closer to what we want. Nothing should break or regress here, this only enables more possibilities.
This commit is contained in:
11
examples/lang/sendrecv-creates.mcl
Normal file
11
examples/lang/sendrecv-creates.mcl
Normal file
@@ -0,0 +1,11 @@
|
||||
exec "a" {
|
||||
shell => "/bin/bash",
|
||||
cmd => "echo hello | tee /tmp/hello",
|
||||
creates => "/tmp/hello",
|
||||
}
|
||||
|
||||
file "/tmp/hello" {
|
||||
mode => "ug=rw,o=",
|
||||
}
|
||||
|
||||
Exec["a"].output -> File["/tmp/hello"].content
|
||||
20
examples/lang/sendrecv-export.mcl
Normal file
20
examples/lang/sendrecv-export.mcl
Normal file
@@ -0,0 +1,20 @@
|
||||
import "os"
|
||||
|
||||
$f = "/tmp/export1"
|
||||
exec "a" {
|
||||
shell => "/bin/bash",
|
||||
cmd => "echo hello | tee ${f}",
|
||||
creates => "${f}",
|
||||
send_output => os.readfile("${f}"), # extra graph event but safer in debug
|
||||
|
||||
Before => File["${f}"],
|
||||
}
|
||||
|
||||
file "${f}" {
|
||||
state => $const.res.file.state.exists,
|
||||
mode => "ug=rw,o=",
|
||||
|
||||
Meta:export => ["*",],
|
||||
}
|
||||
|
||||
Exec["a"].output -> File["${f}"].content
|
||||
Reference in New Issue
Block a user