mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-20 03:13:33 +01:00
Delete grep variables after we use them
This commit is contained in:
parent
37f88a73ff
commit
15d529157f
1 changed files with 6 additions and 2 deletions
|
|
@ -6,7 +6,7 @@
|
|||
GREP_OPTIONS="--color=auto"
|
||||
|
||||
# avoid VCS folders (if the necessary grep flags are available)
|
||||
local VCS_folders="{.bzr,.cvs,.git,.hg,.svn}"
|
||||
VCS_folders="{.bzr,.cvs,.git,.hg,.svn}"
|
||||
|
||||
grep-flag-available() {
|
||||
echo | command grep $1 "" >/dev/null 2>&1
|
||||
|
|
@ -16,7 +16,11 @@ if grep-flag-available --exclude-dir=.cvs; then
|
|||
elif grep-flag-available --exclude=.cvs; then
|
||||
GREP_OPTIONS+=" --exclude=$VCS_folders"
|
||||
fi
|
||||
unfunction grep-flag-available
|
||||
|
||||
export GREP_OPTIONS="$GREP_OPTIONS"
|
||||
export GREP_COLOR='1;32'
|
||||
|
||||
|
||||
# cleanup
|
||||
unset VCS_folders
|
||||
unfunction grep-flag-available
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue