This behavior produces surprising results and forces confusing work arounds.
For example, this pipeline stage:
hello = {
exec "cp $input $output"
x = "foo"
}
Produces an error:
Pipeline failed!
Expected output file ./foo could not be found
This happens because the expression 'x = "foo"' evaluates to a String object,
which, being the last expression in the pipeline stage is treated by Groovy as
a return value. Bpipe then sees it and considers it an output.
The "return value as output" is in fact a relic from when Bpipe had no
"produce", "transform" or "filter" constructs and is now really needed only by
internal parts of Bpipe. Removing it will make Bpipe clearer.
Note: there will still be occasions when the user needs to specify that a
different output from the default one assumed by Bpipe should be forwarded to
the next stage. This should be a separate construct, called "forward".
Original issue reported on code.google.com by ssade...@gmail.com on 6 May 2012 at 2:52
Original issue reported on code.google.com by
ssade...@gmail.com
on 6 May 2012 at 2:52