From a084750335fe96018f4b424bc58849c8f82ed4e5 Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Mon, 5 Jun 2023 01:46:30 +0100 Subject: [PATCH] Redirect find errors to /dev/null --- .config/scripts/functions/fzf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/scripts/functions/fzf b/.config/scripts/functions/fzf index 39a455b..e6fcede 100644 --- a/.config/scripts/functions/fzf +++ b/.config/scripts/functions/fzf @@ -7,7 +7,7 @@ # directory. goto() { - path=$(find $1 | fzf) + path=$(find $1 2> /dev/null | fzf) [ -f "$path" ] && path=$(dirname "$path") cd "$path" } @@ -15,7 +15,7 @@ goto() # Quickly find and edit a file within ~/.config or ~/Documents cfg() { - file=$(find $HOME/.config $HOME/Documents -type f | fzf) + file=$(find $HOME/.config $HOME/Documents -type f 2> /dev/null | fzf) [ -z "$file" ] && return $EDITOR "$file" } @@ -24,7 +24,7 @@ cfg() # session there with the name of the directory. ts() { - dir=$(find -L $HOME/.config $HOME/Documents -type d | fzf) + dir=$(find -L $HOME/.config $HOME/Documents -type d 2> /dev/null | fzf) [ -z "$dir" ] && return tmux new -s $(basename "$dir") -c "$dir" }