We're deliberate in the underlying git hook scripts to avoid failing (and thus breaking git flows) in environmental cases, such as a missing configuration file, but there's a big case we've missed entirely
However, we've overlooked the scenarios where rusty-hook bin is not already on the system and the subsequent cli installation fails, as well as cargo itself not being available. These are not impossible scenarios by any stretch of the imagination, and could occur relatively easily, for example if cargo's bin directory or cargo itself is not on the user's path, and we've had a couple reports (albeit with different causes) of hook issues due to the executables not being found (refs #105 #140).
We're deliberate in the underlying git hook scripts to avoid failing (and thus breaking git flows) in environmental cases, such as a missing configuration file, but there's a big case we've missed entirely
https://github.com/swellaby/rusty-hook/blob/e284e157c71c7a2c99ae790b8d47c1709382ec55/src/hook_files/cli.sh#L47-L57
However, we've overlooked the scenarios where
rusty-hook
bin is not already on the system and the subsequent cli installation fails, as well ascargo
itself not being available. These are not impossible scenarios by any stretch of the imagination, and could occur relatively easily, for example if cargo's bin directory or cargo itself is not on the user's path, and we've had a couple reports (albeit with different causes) of hook issues due to the executables not being found (refs #105 #140).To prevent this problematic behavior, we should:
cargo
availability before attempting to use it and exit with a message should it not be (https://github.com/swellaby/rusty-hook/blob/master/src/hook_files/cli.sh)rusty-hook
availability/installation success instead of just assuming the install succeeded and is available in cases where it wasn't already on thte system https://github.com/swellaby/rusty-hook/blob/master/src/hook_files/hook_script.sh#L13