Unverified Commit 347c91ef authored by 2kybe3's avatar 2kybe3
Browse files
parent c14757a4
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -12,20 +12,16 @@

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "usage";
  version = "3.2.0";
  version = "3.2.1";

  src = fetchFromGitHub {
    owner = "jdx";
    repo = "usage";
    tag = "v${finalAttrs.version}";
    hash = "sha256-0yonwl/2BIkGUs0uOBP+Pjo93NvLVK4QQQj/K4C4NNY=";
    hash = "sha256-L8OQ6GdHoxJROA/lczichG4nNx5UGKxInihel5AaFIc=";
  };

  cargoHash = "sha256-jxTN+La7Ye2okRZGAY6niIvvRf2E4vFFHd1nny7JJDo=";

  patches = [
    ./use-bin-exe-env.patch
  ];
  cargoHash = "sha256-JauKSCp5Fk1shzXE2dy/joYamv7XW2rnIsu4hjIkBUA=";

  postPatch = ''
    substituteInPlace ./examples/*.sh \
+0 −17
Original line number Diff line number Diff line
diff --git a/cli/tests/shell_completions_integration.rs b/cli/tests/shell_completions_integration.rs
index 815c44c..51b5dd9 100644
--- a/cli/tests/shell_completions_integration.rs
+++ b/cli/tests/shell_completions_integration.rs
@@ -25,6 +25,13 @@ fn run_complete_word(usage_bin: &Path, shell: &str, spec_file: &Path, words: &[&
 
 /// Build the usage binary and return its path
 fn build_usage_binary() -> PathBuf {
+    if let Some(usage_path) = std::env::var("CARGO_BIN_EXE_usage")
+        .ok()
+        .filter(|s| !s.is_empty())
+    {
+        return PathBuf::from(usage_path);
+    }
+
     let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
     let workspace_root = manifest_dir.parent().unwrap();