0.0.9 • Published 5 years ago
hubot-pipe v0.0.9
Hubot Pipe
Introduce command piping and subshells to your Hubot commands.
# Expand the output from one command into the invocation of another.
hubot> hubot decide $(hubot echo first) $(hubot echo second)
Definitely "first".
# Append the output from one command to the input of another.
# Equivalent to "hubot echo before $(hubot echo after)".
hubot> hubot echo after | hubot echo before
before afterSubcommands can be nested at arbitrary depths. Pipe sequences can be arbitrarily long, and used within subcommands. (Okay, realistically you're limited by the stack depth.)
pushbot> pushbot echo outer-start $(pushbot echo middle-start $(pushbot echo inner) middle-end) outer-end
outer-start middle-start inner middle-end outer-end
pushbot> pushbot echo 0 $(pushbot echo 2 | pushbot echo 1 )3
pushbot> 0 1 2 3Installing
Add
hubot-pipeto yourpackage.jsonwithnpm install --save hubot-pipe:"dependencies": { "hubot-pipe": "~0.0.4" },Require the module in
external-scripts.json:["hubot-pipe"]Run
npm updateand restart your Hubot.