just: make new bash completion test work from build
This commit is contained in:
parent
21ea0e48c8
commit
8d548d61ec
20
pkgs/by-name/ju/just/fix-just-path-in-tests.patch
Normal file
20
pkgs/by-name/ju/just/fix-just-path-in-tests.patch
Normal file
@ -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 ---
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user