Unset GREP_OPTIONS to avoid unexpected grep behavior (fixes #101)

This commit is contained in:
Yamashita Yuu 2014-01-23 11:09:23 +09:00
parent 403154e09e
commit 9c82314570
3 changed files with 12 additions and 0 deletions

View file

@ -18,6 +18,8 @@ if [ -z "$READLINK" ]; then
exit 1
fi
unset GREP_OPTIONS
resolve_link() {
$READLINK "$1"
}

2
test/libexec/pyenv-grep Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
grep -E "$@"

View file

@ -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"
}