Skip to content

Commit

Permalink
Add feature for shellinstall to ensure clean cargo build
Browse files Browse the repository at this point in the history
  • Loading branch information
WGUNDERWOOD committed Dec 8, 2024
1 parent 13035b4 commit 8f149dd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

Expand Down
5 changes: 4 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default: test doc clippy format shellcheck
default: test doc clippy format shellcheck shellinstall

all: default prof perf binary logo latex

Expand All @@ -18,6 +18,9 @@ test:
doc:
@cargo doc

shellinstall:
@cargo build --features shellinstall

testignored:
@cargo test -- --ignored

Expand Down
12 changes: 6 additions & 6 deletions notes.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8f149dd

Please sign in to comment.