diff --git a/libexec/pyenv b/libexec/pyenv index 05955aa7..e294f638 100755 --- a/libexec/pyenv +++ b/libexec/pyenv @@ -18,6 +18,8 @@ if [ -z "$READLINK" ]; then exit 1 fi +unset GREP_OPTIONS + resolve_link() { $READLINK "$1" } diff --git a/test/libexec/pyenv-grep b/test/libexec/pyenv-grep new file mode 100755 index 00000000..862c66fc --- /dev/null +++ b/test/libexec/pyenv-grep @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +grep -E "$@" diff --git a/test/pyenv.bats b/test/pyenv.bats index 2b33d9fc..759794ee 100644 --- a/test/pyenv.bats +++ b/test/pyenv.bats @@ -45,3 +45,11 @@ load test_helper assert_failure assert_output "pyenv: cannot change working directory to \`$dir'" } + +@test "conflicting GREP_OPTIONS" { + file="${BATS_TMPDIR}/hello" + echo "hello" > "$file" + GREP_OPTIONS="-F" run pyenv grep "hell." "$file" + assert_success + assert_output "hello" +}