mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Unset GREP_OPTIONS
to avoid unexpected grep behavior (fixes #101)
This commit is contained in:
parent
403154e09e
commit
9c82314570
3 changed files with 12 additions and 0 deletions
|
@ -18,6 +18,8 @@ if [ -z "$READLINK" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unset GREP_OPTIONS
|
||||||
|
|
||||||
resolve_link() {
|
resolve_link() {
|
||||||
$READLINK "$1"
|
$READLINK "$1"
|
||||||
}
|
}
|
||||||
|
|
2
test/libexec/pyenv-grep
Executable file
2
test/libexec/pyenv-grep
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
grep -E "$@"
|
|
@ -45,3 +45,11 @@ load test_helper
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output "pyenv: cannot change working directory to \`$dir'"
|
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"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue