diff --git a/pkgs/by-name/ju/just/fix-just-path-in-tests.patch b/pkgs/by-name/ju/just/fix-just-path-in-tests.patch new file mode 100644 index 000000000000..63587ebc698a --- /dev/null +++ b/pkgs/by-name/ju/just/fix-just-path-in-tests.patch @@ -0,0 +1,20 @@ +diff --git a/tests/completions/just.bash b/tests/completions/just.bash +index 6d5c12c..13bff87 100755 +--- a/tests/completions/just.bash ++++ b/tests/completions/just.bash +@@ -17,11 +17,13 @@ reply_equals() { + fi + } + ++just() { ++ cargo run -- "$@" ++} ++ + # --- Initial Setup --- + source "$1" + cd tests/completions +-cargo build +-PATH="$(git rev-parse --show-toplevel)/target/debug:$PATH" + exit_code=0 + + # --- Tests --- diff --git a/pkgs/by-name/ju/just/package.nix b/pkgs/by-name/ju/just/package.nix index a8b66340ec22..1a24bd46d8fc 100644 --- a/pkgs/by-name/ju/just/package.nix +++ b/pkgs/by-name/ju/just/package.nix @@ -2,6 +2,7 @@ , stdenv , fetchFromGitHub , rustPlatform +, bashInteractive , coreutils , installShellFiles , libiconv @@ -42,8 +43,16 @@ rustPlatform.buildRustPackage rec { # Return unchanged string.rs cp $TMPDIR/string.rs tests/string.rs + + # For shell completion tests + export PATH=${bashInteractive}/bin:$PATH + patchShebangs tests ''; + patches = [ + ./fix-just-path-in-tests.patch + ]; + postBuild = '' cargo run --package generate-book