shell-hooks-0.1.2 is not a library.
post hooks while executing a command, just like githooks but for all programs.
- Block the command based on status of prehook.
- Extract async hooks and run using tokio.
- Run sync hooks parallely but before the command.
- Implement this as a feature atop pre-existing shells (mayb ion?).
- Install rust
- Clone this repo.
- Install this tool:
cargo install --path ..
- Alias any tool in
~/.bashrcby wrapping it with
alias git = 'shell-hooks git'.
- Now add your pre and post hook definitions in
~/.local/share/dshell/definitions/. The file format is toml. The filename does not matter, only content does.
Currently there are only two useful fields for hook type, the trigger and action.
- Trigger: It is any command with space replaced with
/and preceded by
- Action: It is any shell command defined as string.
- Execution: Execution mode. Sync can run paralley yet completes before the command. Return status can block the execution of program. Async run parallely with actual command, return code does not matter. Default: Async
If you have any contribution idea, please create an issue.