commit 850fe600b178e964a807305f5869e8c39732d42b
parent e7425d8e157ce5631c6b6408b1d110307cafe4fa
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date: Mon, 9 Jun 2025 21:26:28 +0530
Merge pull request #2039 from N-R-K/shellcheck
fix and ignore some shellcheck warnings
Diffstat:
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