From 4219e03b8483b164d28bf60dde2356ebf66e9dd6 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 3 Feb 2025 00:02:50 +0100 Subject: fix(modules/lf/commands/trash_{clear,restore}): Don't start trash's interactive mode When no files have been selected, trashy's trash client will start an "interactive" mode and prompt for the files _again_. This should obviously be avoided. --- modules/by-name/lf/lf/commands/scripts/trash_clear.sh | 2 +- modules/by-name/lf/lf/commands/scripts/trash_restore.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/by-name/lf') diff --git a/modules/by-name/lf/lf/commands/scripts/trash_clear.sh b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh index e3c2f795..faa3c553 100755 --- a/modules/by-name/lf/lf/commands/scripts/trash_clear.sh +++ b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh @@ -4,6 +4,6 @@ while read -r file; do set -- "$@" "$(pwd)/$file" done <"$(conceal list | fzf --multi --ansi | awk '{for(i=3; i<=NF; i++) {print $i}}' | tmp)" -trash empty --match=exact "$@" +[ "$#" -ne 0 ] && trash empty --match=exact "$@" # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh index aa9ca0dc..f685345f 100755 --- a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh +++ b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh @@ -13,5 +13,5 @@ while read -r file; do set -- "$@" "$(pwd)/$file" done <"$(conceal list | fzf --multi --ansi | awk '{for(i=3; i<=NF; i++) {print $i}}' | tmp)" -trash restore --match=exact "$@" +[ "$#" -ne 0 ] && trash restore --match=exact "$@" # vim: ft=sh -- cgit 1.4.1