diff --git a/test/shimexec/fish b/test/shimexec/fish index cd5574c..3cd2b4d 100755 --- a/test/shimexec/fish +++ b/test/shimexec/fish @@ -1,14 +1,4 @@ #!/usr/bin/env bash -# Find the real fish. -HERE="$(cd "$(dirname "$0")" && pwd)" -while read -d ':' -r dir; do - if [[ "$dir" == "$HERE" || -z "$dir" ]]; then continue; fi - if [[ -f "${dir}/fish" ]]; then - TMPDIR='' "${dir}/fish" "$@" - exit $? - fi -done <<<"$PATH:" - -# Print error and exit. -echo "fish was not found on \$PATH" 1>&2 -exit 127 +# Run bash, but with executable name as `fish`. +exec -a "${SHIM_ARGV0:-fish}" bash "$@" +exit $? diff --git a/test/suite/batpipe.sh b/test/suite/batpipe.sh index 66c4c24..4a4776c 100644 --- a/test/suite/batpipe.sh +++ b/test/suite/batpipe.sh @@ -11,9 +11,7 @@ test:detected_bash_shell() { } test:detected_fish_shell() { - description "Test it can detect a bash shell." - command -v "fish" &>/dev/null || skip "Test requires fish shell." - fish -c 'exit 0' &>/dev/null || skip "Test requires fish shell." # This is in case it finds "fish" in shimexec dir. + description "Test it can detect a fish shell." output="$(SHELL="fish" fish --login -c "$(batpipe_path)")" grep '^set -x' <<< "$output" >/dev/null || fail "Detected the wrong shell for fish."