davidferguson / pibakery-blocks

All the blocks for the Pi Bakery program
GNU General Public License v3.0
242 stars 86 forks source link

Ability to pipe STDOUT from one block to another? #13

Open rjcorwin opened 8 years ago

rjcorwin commented 8 years ago

Hi David - RJ here from Open Pipe Kit, we exchanged comments on Hacker News. I see from your Docs that we could add JSON files to the Open Pipe Kit CLIs in order for them to be configurable in PiBakery, but how about piping STDOUT from one block to another? Is that something that is currently possible in PiBakery? I'm also interested in running these block combinations at an interval so you can do something like "Every 60 seconds run the Raspberry Pi CPU temperature pull command and pipe the STDOUT to the Adafruit IO push command".

davidferguson commented 8 years ago

At the moment, each block acts independently of all the other blocks, so you can't pipe output from one into another. The only way to do something like this would be to have blocks read and write to temporary files, which is a bit messy.

At the moment, I'm planning on just having the On First Boot, On Every Boot and On Next boot startup blocks, but I will be adding a block to create cron jobs soon. Although that's not exactly what you described, hopefully that'll be of use to you.