From 8f149ddf39250e79393a20268f2ded2e888806da Mon Sep 17 00:00:00 2001 From: William G Underwood <42812654+WGUNDERWOOD@users.noreply.github.com> Date: Sun, 8 Dec 2024 13:01:22 +0000 Subject: [PATCH] Add feature for shellinstall to ensure clean cargo build --- Cargo.toml | 3 +++ build.rs | 7 +++++-- justfile | 5 ++++- notes.org | 12 ++++++------ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c070509..e9720b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,9 @@ regex = "1.11.1" similar = "2.6.0" toml = "0.8.19" +[features] +shellinstall = [] + [build-dependencies] clap = { version = "4.5.23", features = ["cargo"] } clap_complete = "4.5.38" diff --git a/build.rs b/build.rs index 1fcc207..5ca8223 100644 --- a/build.rs +++ b/build.rs @@ -11,8 +11,11 @@ fn main() -> Result<(), Error> { println!("cargo::rerun-if-changed=src/"); println!("cargo::rerun-if-changed=build.rs"); println!("cargo::rerun-if-changed=Cargo.toml"); - build_completion()?; - build_man()?; + if std::env::var("CARGO_FEATURE_SHELLINSTALL").is_ok() { + println!("cargo::warning=shellinstall"); + build_completion()?; + build_man()?; + } Ok(()) } diff --git a/justfile b/justfile index b097cf1..16a36d6 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,4 @@ -default: test doc clippy format shellcheck +default: test doc clippy format shellcheck shellinstall all: default prof perf binary logo latex @@ -18,6 +18,9 @@ test: doc: @cargo doc +shellinstall: + @cargo build --features shellinstall + testignored: @cargo test -- --ignored diff --git a/notes.org b/notes.org index 8db1d6d..9b4f92d 100644 --- a/notes.org +++ b/notes.org @@ -21,15 +21,15 @@ *** DONE just nix ** DONE Update Rust version *** DONE just upgrade -** Run tests +** DONE Run tests *** DONE just *** DONE just perf *** DONE Update performance results in README.md -** Push to GitHub and check tests pass -** Create a git tag -*** git tag vX.X.X -*** git push --tags -** Publish to crates.io with cargo publish +** DONE Push to GitHub and check tests pass +** DONE Create a git tag +*** DONE git tag vX.X.X +*** DONE git push --tags +** DONE Publish to crates.io with cargo publish ** Publish GitHub release with notes *** GitHub binaries published automatically with actions ** Publish in nixpkgs