diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2017-04-29 12:09:26 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2017-04-29 19:20:00 +0530 |
commit | bac4c27191b61f8d2cee4b7331b48cfba5b7b294 (patch) | |
tree | fa7d7432b8767feb54b366a8e5de9c460605ccb6 /misc | |
parent | 64d06ccaeea8eee1040748e16ddb875f552ee6dc (diff) | |
download | nnn-bac4c27191b61f8d2cee4b7331b48cfba5b7b294.tar.gz |
Update scripts
Diffstat (limited to 'misc')
-rw-r--r-- | misc/quitcd/quitcd.bash | 7 | ||||
-rw-r--r-- | misc/quitcd/quitcd.fish | 3 | ||||
-rw-r--r-- | misc/quitcd/quitcd.zsh | 7 |
3 files changed, 14 insertions, 3 deletions
diff --git a/misc/quitcd/quitcd.bash b/misc/quitcd/quitcd.bash index 94accd6..71abf1f 100644 --- a/misc/quitcd/quitcd.bash +++ b/misc/quitcd/quitcd.bash @@ -2,7 +2,12 @@ export NNN_TMPFILE="/tmp/nnn" n() { - nnn -d + if [ -n "$1" ]; then + nnn -d "$1" + else + nnn -d + fi + if [ -f $NNN_TMPFILE ]; then . $NNN_TMPFILE rm $NNN_TMPFILE diff --git a/misc/quitcd/quitcd.fish b/misc/quitcd/quitcd.fish index 35551c8..f438009 100644 --- a/misc/quitcd/quitcd.fish +++ b/misc/quitcd/quitcd.fish @@ -1,7 +1,8 @@ export NNN_TMPFILE="/tmp/nnn" function n --description 'support nnn quit and change directory' - nnn -d + nnn -d $argv[1] + if test -e $NNN_TMPFILE . $NNN_TMPFILE rm $NNN_TMPFILE diff --git a/misc/quitcd/quitcd.zsh b/misc/quitcd/quitcd.zsh index 94accd6..71abf1f 100644 --- a/misc/quitcd/quitcd.zsh +++ b/misc/quitcd/quitcd.zsh @@ -2,7 +2,12 @@ export NNN_TMPFILE="/tmp/nnn" n() { - nnn -d + if [ -n "$1" ]; then + nnn -d "$1" + else + nnn -d + fi + if [ -f $NNN_TMPFILE ]; then . $NNN_TMPFILE rm $NNN_TMPFILE |