commit ae019dc46ed41921d28172166b18b63780e6c8d8 parent 340dce67e19917944986417fd780a3df3f905698 Author: Alex Balgavy <alex@balgavy.eu> Date: Mon, 9 May 2022 22:18:06 +0200 lf: fix paste_link Diffstat:
M | lf/lfrc | | | 22 | +++++++++++----------- |
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/lf/lfrc b/lf/lfrc @@ -163,18 +163,18 @@ cmd paste &{{ # paste as a symbolic link to original cmd paste_link %{{ - for file in $(cat ~/.local/share/lf/files); do - if [ ! -n "${mode+1}" ]; then - mode="$file" - continue - fi - files+=("$file") - done - if [ -z "$files" ] || [ "${#files[@]}" -lt 1 ]; then - lf -remote "send $id echo no files to link files: ${files}" - exit 0 + if [ "$(wc -l < ~/.local/share/lf/files)" -gt 1 ]; then + while read -r file; do + case "$file" in + copy|move) ;; + *) + ln -s "$file" . + ;; + esac + done < ~/.local/share/lf/files + else + lf -remote "send $id echo no files to link." fi - ln -sr $files -t . }} cmd paste_rename %{{