bike-barn / hermit

A home directory configuration management assistant
http://bike-barn.github.io/hermit/
Other
33 stars 7 forks source link

Make subcommands check for pre- and post-command hooks #51

Open RadicalZephyr opened 9 years ago

RadicalZephyr commented 9 years ago

This is a prelim to #50, but they can both be done at the same time.

This is similar in concept to githooks. And as far as I can tell, it's a search in a couple places for files with the appropriate name. Might be some neat way to get the name of the current file and use that as the name of the hook to be found so it can be reused by all the commands.

RadicalZephyr commented 9 years ago

Something like $(basename $file)-hook ought to do it. Then you just define a hook path and search for hooks.

If there are multiple hooks, do they all get run? Or just the "first" one?

reillysiemens commented 8 years ago

@RadicalZephyr's $(basename $file)-hook will be useless in the switch to Rust, but I feel like this is functionality that shouldn't be overlook in the switch, so let's not close this just yet.