Skip to content

Commit

Permalink
chore: revert to getopts for argument parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Scandiravian authored and Christian Ravn committed Oct 25, 2021
1 parent 10a1ed8 commit 21c7e96
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 277 deletions.
250 changes: 27 additions & 223 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ license = "MIT"
repository = "https://github.com/swellaby/rusty-hook"
readme = "README.md"
edition = "2018"
keywords = [ "hooks", "githook", "git", "hook", "commit" ]
categories = [ "development-tools" ]
keywords = ["hooks", "githook", "git", "hook", "commit"]
categories = ["development-tools"]
exclude = [
".coverage/**",
".testresults/**",
Expand All @@ -32,16 +32,16 @@ exclude = [

[dependencies]
ci_info = "0.14.2"
clap = "3.0.0-beta.4"
toml = "0.5.8"
getopts = "0.2.21"
nias = "0.7.0"
toml = "0.5.8"

[build-dependencies]
ci_info = "0.14.2"
toml = "0.5.8"
nias = "0.7.0"

[badges]
azure-devops = { project = "swellaby/opensource", pipeline = "rusty-hook.linux-pr", build="49" }
azure-devops = { project = "swellaby/opensource", pipeline = "rusty-hook.linux-pr", build = "49" }
codecov = { repository = "swellaby/rusty-hook", branch = "master", service = "github" }
maintenance = { status = "actively-developed" }
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#[path = "src/rusty_hook.rs"]
mod rusty_hook;

use std::env;
use std::process::exit;
use std::{env, vec};

fn main() {
if ci_info::is_ci() {
Expand All @@ -16,7 +16,7 @@ fn main() {
nias::get_file_writer(),
nias::get_file_existence_checker(),
Some(&target_directory),
vec![],
&[],
) {
println!(
"Fatal error encountered during initialization. Details: {}",
Expand Down
2 changes: 1 addition & 1 deletion src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn setup_hooks<F, G>(
run_command: F,
write_file: G,
root_directory_path: &str,
hook_file_skip_list: &[&str],
hook_file_skip_list: &[String],
) -> Result<(), String>
where
F: Fn(
Expand Down
2 changes: 1 addition & 1 deletion src/hook_files/hook_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ else
fi

# shellcheck disable=SC2046
rusty-hook run --hook "${hookName}" $([ -z "$gitParams" ] && echo "" || echo "-- $gitParams")
rusty-hook run --hook "${hookName}" "${gitParams}"
handleRustyHookCliResult $? "${hookName}"
Loading

0 comments on commit 21c7e96

Please sign in to comment.