diff --git a/Cargo.toml b/Cargo.toml index a6beb09..e0c8e55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,13 @@ readme = "README.md" repository = "https://github.com/dustinblackman/cargo-run-bin" rust-version = "1.70.0" description = "Build, cache, and run binaries scoped in Cargo.toml rather than installing globally. This acts similarly to npm run and gomodrun, and allows your teams to always be running the same tooling versions." +exclude = [ + ".cargo-husky", + "tests", + "cliff.toml", + "deny.toml", + "rust-toolchain.toml" +] [[bin]] name = "cargo-bin" diff --git a/src/cli.rs b/src/cli.rs index 8718990..89bc72f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -17,13 +17,13 @@ fn install_all_binaries() -> Result<()> { binary::install(binary_package)?; } - println!("\x1b[32m{}\x1b[0m", "Done!"); + println!("\x1b[32mDone!\x1b[0m"); return Ok(()); } fn sync_aliases() -> Result<()> { cargo_config::sync_aliases()?; - println!("\x1b[32m{}\x1b[0m", "Done!"); + println!("\x1b[32mDone!\x1b[0m"); return Ok(()); } diff --git a/src/shims.rs b/src/shims.rs index 3c54484..fd72359 100644 --- a/src/shims.rs +++ b/src/shims.rs @@ -19,7 +19,7 @@ fn create_shim(binary: &str, bin_path: path::PathBuf) -> Result<()> { .unwrap() .to_string(); - if !vec!["bash", "zsh", "sh"].contains(&&*shell) { + if !["bash", "zsh", "sh"].contains(&&*shell) { shell = "sh".to_string(); } diff --git a/tests/cargo_config_test.rs b/tests/cargo_config_test.rs index f027588..c6f4cce 100644 --- a/tests/cargo_config_test.rs +++ b/tests/cargo_config_test.rs @@ -14,4 +14,4 @@ mod sync_aliases { assert!(res.is_ok()); assert!(toml_str.contains("nextest = [\"bin\", \"cargo-nextest\"]")); } -} \ No newline at end of file +} diff --git a/tests/shims_test.rs b/tests/shims_test.rs index 197cd0b..a75d44d 100644 --- a/tests/shims_test.rs +++ b/tests/shims_test.rs @@ -1,5 +1,6 @@ -use anyhow::Result; use std::fs; + +use anyhow::Result; use cargo_run_bin::metadata; fn clean_shims() -> Result<()> { @@ -8,13 +9,15 @@ fn clean_shims() -> Result<()> { fs::remove_dir_all(&bin_dir)?; } - return Ok(()); + Ok(()) } mod sync_shims { use std::fs; - use cargo_run_bin::shims::sync; + use cargo_run_bin::metadata; + use cargo_run_bin::shims::sync; + use super::clean_shims; #[test] @@ -68,7 +71,6 @@ mod sync_shims { assert!(content.starts_with("#!/usr/bin/env sh")); } - #[test] #[cfg(not(target_family = "unix"))] fn it_creates_shims() {