cassava / repoctl

Make it easy to manage your local Arch Linux repository.
MIT License
128 stars 13 forks source link

Support hooks #21

Closed cassava closed 8 years ago

cassava commented 8 years ago

Let's say that my repository is actually online. Then it would be handy if after every update operation I could have it synchronized.

There are several ways this can go down, but I will lean towards the git style. In the configuration directory, there is a hooks folder. There can either be a single file, named after the operation, or there can be a directory.

~/.config/repoctl/hooks/update
~/.config/repoctl/hooks/update.d/upload.sh

All matching files will be executed. The one requirement is that the files can be run as is, otherwise they will be ignored.

Last point is how to handle script output. If the script ends with a nonzero response, execution of repoctl will continue, but the output of the script will be printed. Otherwise it depends on the verbosity settings.

cassava commented 8 years ago

I have started with a simple system of running a single command before and after actions. If it turns out that people need a more complex system, then this can be revisited. Commit 9406a1ef3edb4ca38af9c33c254a454bbb199a17 implements this change.