nnn

mirror of https://github.com/jarun/nnn
Log | Files | Refs | README | LICENSE

commit 55cbad42e7a65201e453a159fc034fcc4832faff
parent 4534fd3f0cea6573db413b7bd11c03ba72ffaf9c
Author: beast989898 <98_beast_98@protonmail.com>
Date:   Sat,  2 Aug 2025 10:02:20 -0400

Notification option for curl failure

Diffstat:
Mplugins/dragdrop | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/plugins/dragdrop b/plugins/dragdrop @@ -66,12 +66,19 @@ elif [ "$resp" = "r" ]; then "$dnd" --print-path --target 2>/dev/null | while read -r f do if printf "%s" "$f" | grep -q '^\(https\?\|ftps\?\|s\?ftp\)://' ; then - if curl -fsLJOS "$f"; then + output=$(curl -fsLJOS "$f" 2>&1) + if [ $? = 0 ]; then filename="$(basename "${f%%\?*}")" add_file "$PWD/$filename" if [ $notify = 1 ]; then notify-send "Download Complete" "Finished downloading $filename" fi + else + if [ $notify = 1 ]; then + notify-send "Download Failed" "$output" + else + echo "Download Failed: $output" + fi fi elif [ -e "$f" ]; then add_file "$f"