johnae / spook

Lightweight programmable evented utility based on LuaJIT and ljsyscall
Other
35 stars 0 forks source link

Allow env for commands. Actually use spook execute in command. #40

Closed johnae closed 7 years ago

johnae commented 7 years ago

This allows env variables (in the form of a kv table) to be passed both to the command creation and the actual running of the command (the later takes precedence over any keys set in command).

Eg.

env_cmd = command "ruby", env: {SOMEKEY: "VALUE ONE"}

env_cmd "printenv.rb" -- would print SOMEKEY = VALUE ONE
env_cmd "printenv.rb", {SOMEKEY: "VALUE TWO"} -- would print SOMEKEY = VALUE TWO