Update tag
aliases to utilize mktemp for the temporary file
This commit is contained in:
parent
559a0b453e
commit
f202c025c0
1 changed files with 16 additions and 2 deletions
|
@ -1,11 +1,25 @@
|
||||||
if command -v tag &> /dev/null; then
|
if command -v tag &> /dev/null; then
|
||||||
if command -v ag &> /dev/null; then
|
if command -v ag &> /dev/null; then
|
||||||
tag() { export TAG_SEARCH_PROG=ag; command tag "$@"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2>/dev/null }
|
tag() {
|
||||||
|
export TAG_SEARCH_PROG=ag
|
||||||
|
export TAG_ALIAS_FILE="$(mktemp)"
|
||||||
|
command tag "$@"
|
||||||
|
source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} &> /dev/null
|
||||||
|
rm -f "$TAG_ALIAS_FILE" &> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
alias ag=tag
|
alias ag=tag
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v rg &> /dev/null; then
|
if command -v rg &> /dev/null; then
|
||||||
trg() { export TAG_SEARCH_PROG=rg; command tag "$@"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2>/dev/null }
|
trg() {
|
||||||
|
export TAG_SEARCH_PROG=rg
|
||||||
|
export TAG_ALIAS_FILE="$(mktemp)"
|
||||||
|
command tag "$@"
|
||||||
|
source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} &> /dev/null
|
||||||
|
rm -f "$TAG_ALIAS_FILE" &> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
alias rg=trg
|
alias rg=trg
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue