swellaby / rusty-hook

git hook manager, geared toward Rust projects
MIT License
207 stars 11 forks source link

Add cli version check #46

Closed calebcartwright closed 5 years ago

calebcartwright commented 5 years ago

Description

Update the the git hook scripts to support upgrading the rusty-hook CLI conditionally, such as when the CLI version is less than X.

High level flow would be something like:

if cliVersion < minimumCliVersion; then 
  cargo install --force rusty-hook
fi

Value

The hook script files will be automatically upgraded, but the CLI is only installed if it doesn't already exist on the system. This could eventually lead to a lot of version drift between the script files and the CLI, and having the ability the conditionally upgrade the CLI version from the scripts would better enable keeping them more closely synchronized and simplifying the development/deployment process.