swellaby / rusty-hook

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

Don't attempt to init during bin install #144

Open calebcartwright opened 3 years ago

calebcartwright commented 3 years ago

We've a custom build script that's used to provide a shortcut path for folks that want to make it easy for their users to enable hooks in their local env, and this works by leveraging the internal init function.

That's well and good for the lib cases (added as a dev dep and compiled during a cargo test), but there's no reason to attempt to init when building the bin/cli target (e.g. cargo install rusty-hook)

Should be able to use one of cargo's vars to conditionally run the steps in the build script

https://github.com/swellaby/rusty-hook/blob/master/build.rs