nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0be157ff48fcf521532a4fbe19a3cbbcb4f1b608
parent e7425d8e157ce5631c6b6408b1d110307cafe4fa
Author: NRK <nrk@disroot.org>
Date:   Mon,  9 Jun 2025 14:14:34 +0000

fix and ignore some shellcheck warnings

Diffstat:
Mplugins/chksum | 4++--
Mplugins/nuke | 1+
Mplugins/renamer | 13+++++++------
3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/plugins/chksum b/plugins/chksum @@ -48,7 +48,7 @@ fi if [ "$resp" = "s" ]; then checksum_type - sed 's|'"$PWD/"'||g' < "$selection" | xargs -0 -I{} ${chsum}sum {} > "checksum_$(date '+%Y%m%d%H%M').$chsum" + sed 's|'"$PWD/"'||g' < "$selection" | xargs -0 -I{} "${chsum}sum" {} > "checksum_$(date '+%Y%m%d%H%M').$chsum" # Clear selection if [ -p "$NNN_PIPE" ]; then @@ -70,6 +70,6 @@ elif [ -n "$1" ]; then elif [ -d "$1" ]; then checksum_type file=$(basename "$1").$chsum - find "$1" -type f -exec ${chsum}sum "{}" + > "$file" + find "$1" -type f -exec "${chsum}sum" "{}" + > "$file" fi fi diff --git a/plugins/nuke b/plugins/nuke @@ -553,4 +553,5 @@ handle_mime "${MIMETYPE}" handle_blocked "${MIMETYPE}" handle_fallback +# shellcheck disable=SC2317 exit 1 diff --git a/plugins/renamer b/plugins/renamer @@ -6,7 +6,7 @@ # - Try to mimic current batch rename functionality but with correct # handling of edge cases by qmv or vidir. # - Qmv opens with hidden files if no selection is used. Selected -# directories are shown. +# directories are shown. # - Vidir don't show directories nor hidden files. # # Shell: POSIX compliant @@ -15,11 +15,11 @@ selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} if type qmv >/dev/null 2>&1; then - batchrenamesel="qmv -fdo -da" - batchrename="qmv -fdo -a" + batchrenamesel="qmv -fdo -da" + batchrename="qmv -fdo -a" elif type vidir >/dev/null 2>&1; then - batchrenamesel="vidir" - batchrename="vidir" + batchrenamesel="vidir" + batchrename="vidir" else printf "there is not batchrename program installed." exit @@ -32,6 +32,7 @@ fi if [ "$resp" = "y" ]; then # -o flag is necessary for interactive editors + # shellcheck disable=SC2086 xargs -o -0 $batchrenamesel < "$selection" # Clear selection @@ -40,6 +41,6 @@ if [ "$resp" = "y" ]; then fi elif [ ! "$(LC_ALL=C ls -a)" = ". .." ]; then - # On older systems that don't have ls -A + # On older systems that don't have ls -A $batchrename fi