commit 951e7705c8fb6553487d8e917873c3ba27dd3525
parent 151f95e1b93f70ebc4d2babde6344895beedf39a
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 30 May 2018 11:11:48 -0400
Use POSIX-compatible command check
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/links/.profile b/links/.profile
@@ -47,7 +47,7 @@ export GPG_TTY=`tty`
[ -d ~/torch/install/bin ] && export PATH=~/torch/install/bin:$PATH
[ -d ~/code/tensorflow ] && alias tensorflow='source ~/code/tensorflow/bin/activate'
-if _has fzf; then
+if [ -x "$(command -v fzf)" ]; then
export FZF_DEFAULT_OPTS="
--preview '(highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -100'
@@ -58,7 +58,7 @@ if _has fzf; then
export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND"
# use ripgrep if available
- if _has rg; then
+ if [ -x "$(command -v rg)" ]; then
# --files: List files that would be searched but do not search
# --no-ignore: Do not respect .gitignore, etc...
# --hidden: Search hidden files and folders
@@ -67,7 +67,7 @@ if _has fzf; then
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --glob "!.git/*"'
# use the_silver_searcher if available
- elif _has ag; then
+ elif [ -x "$(command -v ag)" ]; then
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -f --nocolor -g ""'
fi
fi