mirror of
https://github.com/jarun/nnn.git
synced 2024-11-10 13:23:12 +00:00
Skip rm invocation when no files to delete
This commit is contained in:
parent
8b9e0edc94
commit
1418ecde0d
|
@ -58,10 +58,10 @@ read -r force
|
||||||
|
|
||||||
if [ "$force" = "f" ]; then
|
if [ "$force" = "f" ]; then
|
||||||
#shellcheck disable=SC2016
|
#shellcheck disable=SC2016
|
||||||
sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 sh -c 'rm -f "$0" "$@" </dev/tty'
|
sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -f "$0" "$@" </dev/tty'
|
||||||
else
|
else
|
||||||
#shellcheck disable=SC2016
|
#shellcheck disable=SC2016
|
||||||
sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 sh -c 'rm -i "$0" "$@" </dev/tty'
|
sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -i "$0" "$@" </dev/tty'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm "$tmpfile"
|
rm "$tmpfile"
|
||||||
|
|
Loading…
Reference in a new issue