Skip to content

Instantly share code, notes, and snippets.

@samuell
Last active July 17, 2018 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuell/cc28464275b531ba2a33ee97708b8f1e to your computer and use it in GitHub Desktop.
Save samuell/cc28464275b531ba2a33ee97708b8f1e to your computer and use it in GitHub Desktop.
package main
import (
sp "github.com/samuell/scipipe"
)
func main() {
hello := sp.Sh("echo foo > {o:out}")
hello.OutPathFuncs["out"] = func() string {
return "hello.txt"
}
world := sp.Sh("echo $(cat {i:in}) World >> {o:out}")
world.OutPathFuncs["bar"] = func() string {
return world.GetInPath("in") + ".world.txt"
}
world.InPorts["in"] = hello.OutPorts["out"]
hello.Init()
world.Init()
<-world.OutPorts["out"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment