How to pipe with different contexts?
dannys42 opened this issue · 0 comments
dannys42 commented
Thanks for the great library! Is there a way to do the equivalent of "(cd srcdir && tar cf - . ) | (cd dstdir && tar xf - )" ?
I'd like to do this following this pattern:
var file = try open(forWriting: "output.txt")
runAsync("cmd1", "arg1").stdout.runAsync("cmd2").stdout.write(to: &file)
Rather than simply doing bash execution to prevent unintended string manipulation. Do you have a recommendation on how to approach this?