Unverified Commit f1d450eb authored by 2kybe3's avatar 2kybe3
Browse files

usage: 3.0.0 -> 3.2.0

parent fca21eb0
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -12,16 +12,20 @@

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

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

  cargoHash = "sha256-RNeHa3V4oCvtiR6/ntTegKl62ByWZbFeliFJVgsHYrQ=";
  cargoHash = "sha256-jxTN+La7Ye2okRZGAY6niIvvRf2E4vFFHd1nny7JJDo=";

  patches = [
    ./use-bin-exe-env.patch
  ];

  postPatch = ''
    substituteInPlace ./examples/*.sh \
+17 −0
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();