Support MacOS "GNU Awk"

This commit is contained in:
Reid 'arrdem' McKenzie 2017-04-17 17:29:17 -07:00
parent 7ebdd0490f
commit 4943f46f75

View file

@ -1,7 +1,12 @@
# goto.zsh
function _awk {
which awk &>/dev/null && awk $@ || \
which gawk &>/dev/null && gawk $@
}
function _gotofile {
echo $GOTO_FILE "$HOME/.labels.tsv" | awk "{print \$1}"
echo $GOTO_FILE "$HOME/.labels.tsv" | _awk "{print \$1}"
}
function _makeLabel {
@ -35,7 +40,7 @@ function goto {
}
function _goto {
for label in $(awk '{print $1}' `_gotofile`)
for label in $(_awk '{print $1}' `_gotofile`)
do
compadd "$@" $label
done