Inject changed file into command#8
Conversation
Allows users to programatically use $FILE (or $EVENT) in their commands. Such as: ``` watchy -w lib -- say "\$FILE changed" ``` Note that we escape the $FILE env value otherwise it gets evaluated immediately.
|
It also means you can do things like this: Which might look a little nuts, but can take the .less file that actually changed and then only process that changed file. |
|
This already works, no? ~ FOO=bar watchy -w . -- 'echo $FOO'
[watchy] echo $FOO Spawning...
bar
[watchy] echo $FOO Exited cleanly |
|
No, What |
|
Ahh, I see what you mean. That sounds like a nice feature, thanks! |
Inject changed file into command
|
I'm seeing a failure with 0.5.5 that goes away when downgrading to 0.5.4: I'm running And the |
There was a problem hiding this comment.
I think you want to copy everything from process.env first (and then add your EVENT and FILE - ideally only if they don't already exist).
|
Proposed fix in #9. |
Allows users to programmatically use $FILE (or $EVENT) in their commands.
Such as:
Note that we escape the $FILE env value otherwise it gets evaluated immediately.
(Please excuse the typo in the actual commit, and the unsolicited PR!)