hawkins / watchdog

⚠️ Watch filesystem for changes and then run a command
2 stars 0 forks source link

Supply event details to command #11

Open hawkins opened 5 years ago

hawkins commented 5 years ago

I'm thinking it could be cool to send event details to the command, so the command can do something with the file notified etc.

I.e.,

echo "a" > lib/test
watchdog "cat {f}" -- lib/test

# in another terminal ...
echo "b" >> lib/test

# watchdog runs `cat lib/test`:
a
b

I'm concerned about how this means we have to parse the command now, and I don't want to trip up when programs like awk need {} or similar sequences.