From: Patrick Date: Fri, 16 Sep 2022 00:11:34 +0000 (-0700) Subject: slightly improve and optimize n.fish X-Git-Tag: v4.7~14^2~2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3dac035819a88ad366338822c862679754c5b257;p=nnn.git slightly improve and optimize n.fish The expr is redundant because `test -ge` treats strings as numbers already. --- diff --git a/misc/quitcd/quitcd.fish b/misc/quitcd/quitcd.fish index c9902080..12d3b6d2 100644 --- a/misc/quitcd/quitcd.fish +++ b/misc/quitcd/quitcd.fish @@ -4,11 +4,9 @@ function n --wraps nnn --description 'support nnn quit and change directory' # Block nesting of nnn in subshells - if test -n "$NNNLVL" - if [ (expr $NNNLVL + 0) -ge 1 ] - echo "nnn is already running" - return - end + if test -n "$NNNLVL" && test $NNNLVL -ge 1 + echo "nnn is already running" + return end # The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)