Redirect find errors to /dev/null

This commit is contained in:
Sheldon Lee 2023-06-05 01:46:30 +01:00
parent b19ab6990b
commit a084750335

View File

@ -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"
}