From 7eda5e8c93f57a82d3e17b2034df364e842c6b18 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Sat, 1 Oct 2022 12:36:18 -0700 Subject: [PATCH] Remove script dependency on fzf.sh library file --- bin/cptemplate | 2 +- bin/fedit | 2 +- lib/fzf.sh | 7 ------- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 lib/fzf.sh diff --git a/bin/cptemplate b/bin/cptemplate index a5396a5..ebe863a 100755 --- a/bin/cptemplate +++ b/bin/cptemplate @@ -100,7 +100,7 @@ if ! [[ -d "$DIR" ]]; then fi files="$(find_files "$DIR")" -selected_file="$(run_fzf "$files")" +selected_file="$(fzf --select-1 --exit-0 <<< "$files")" # Check if target exists if [[ -f "$1" && -z "$FORCE_OVERWRITE" ]]; then diff --git a/bin/fedit b/bin/fedit index c0c4050..28f6bfa 100755 --- a/bin/fedit +++ b/bin/fedit @@ -121,7 +121,7 @@ elif [[ -n $NO_IGNORE_VCS ]]; then fi files="$(find_files $DIR "${extra_opts[@]}")" -selected_file="$(run_fzf "$files")" +selected_file="$(fzf --select-1 --exit-0 <<< "$files")" if [[ -w "${selected_file}" ]]; then "$EDITOR" "$selected_file" diff --git a/lib/fzf.sh b/lib/fzf.sh deleted file mode 100644 index bd311d8..0000000 --- a/lib/fzf.sh +++ /dev/null @@ -1,7 +0,0 @@ -## FZF helpers - -FZF_OPTS=('--select-1' '--exit-0') - -run_fzf() { - fzf "${FZF_OPTS[@]}" -- <<<"$@" || return 2 -}