aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/ndiff
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-11-22 02:14:25 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-11-22 11:13:34 +0530
commit1cca9e4b72b106374f203890b266f18609deefe3 (patch)
tree9f281f4b4de296c54d13dc9c7e214f58835636a7 /plugins/ndiff
parentee2dcb1de7d3e82b330f49ee9fb5dfd4608207ff (diff)
downloadnnn-1cca9e4b72b106374f203890b266f18609deefe3.tar.gz
shellcheck fixes
Diffstat (limited to 'plugins/ndiff')
-rwxr-xr-xplugins/ndiff8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/ndiff b/plugins/ndiff
index f5ca0dc..3680627 100755
--- a/plugins/ndiff
+++ b/plugins/ndiff
@@ -10,14 +10,14 @@
selection=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection
-if [ -s $selection ]; then
+if [ -s "$selection" ]; then
arr=$(tr '\0' '\n' < "$selection")
if [ "$(echo "$arr" | wc -l)" -gt 1 ]; then
f1="$(echo "$arr" | sed -n '1p')"
f2="$(echo "$arr" | sed -n '2p')"
if [ -d "$f1" ] && [ -d "$f2" ]; then
- dir1=$(mktemp "${TMPDIR:-/tmp}"/nnn-$(basename "$f1").XXXXXXXX)
- dir2=$(mktemp "${TMPDIR:-/tmp}"/nnn-$(basename "$f2").XXXXXXXX)
+ dir1=$(mktemp "${TMPDIR:-/tmp}"/nnn-"$(basename "$f1")".XXXXXXXX)
+ dir2=$(mktemp "${TMPDIR:-/tmp}"/nnn-"$(basename "$f2")".XXXXXXXX)
ls -A1 "$f1" > "$dir1"
ls -A1 "$f2" > "$dir2"
vimdiff "$dir1" "$dir2"
@@ -27,7 +27,7 @@ if [ -s $selection ]; then
# Vim: Warning: Input is not from a terminal
# xargs -0 -o vimdiff < $selection
- xargs -0 vimdiff +0 < $selection
+ xargs -0 vimdiff +0 < "$selection"
fi
else
echo "needs at least 2 files or directories selected for comparison"