Remove script dependency on fzf.sh library file

This commit is contained in:
Eric Torres 2022-10-01 12:36:18 -07:00
parent a8972362fc
commit 7eda5e8c93
3 changed files with 2 additions and 9 deletions

View File

@ -100,7 +100,7 @@ if ! [[ -d "$DIR" ]]; then
fi fi
files="$(find_files "$DIR")" files="$(find_files "$DIR")"
selected_file="$(run_fzf "$files")" selected_file="$(fzf --select-1 --exit-0 <<< "$files")"
# Check if target exists # Check if target exists
if [[ -f "$1" && -z "$FORCE_OVERWRITE" ]]; then if [[ -f "$1" && -z "$FORCE_OVERWRITE" ]]; then

View File

@ -121,7 +121,7 @@ elif [[ -n $NO_IGNORE_VCS ]]; then
fi fi
files="$(find_files $DIR "${extra_opts[@]}")" files="$(find_files $DIR "${extra_opts[@]}")"
selected_file="$(run_fzf "$files")" selected_file="$(fzf --select-1 --exit-0 <<< "$files")"
if [[ -w "${selected_file}" ]]; then if [[ -w "${selected_file}" ]]; then
"$EDITOR" "$selected_file" "$EDITOR" "$selected_file"

View File

@ -1,7 +0,0 @@
## FZF helpers
FZF_OPTS=('--select-1' '--exit-0')
run_fzf() {
fzf "${FZF_OPTS[@]}" -- <<<"$@" || return 2
}