aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mischievous Meerkat <engineerarun@gmail.com>2019-07-10 19:14:25 +0530
committerGravatar GitHub <noreply@github.com>2019-07-10 19:14:25 +0530
commit74a7d2245c02bd77d2dca63f5005a63842514f05 (patch)
tree1d58decbb3cdd1c7e8123b1fa1eaaacbfd93b193
parent2c84f24812524833d2c486e8ca30c2de4b0f7f14 (diff)
parent66fa6fc682f803a82998d03e94166a94fbad504a (diff)
downloadnnn-74a7d2245c02bd77d2dca63f5005a63842514f05.tar.gz
Merge pull request #303 from fokinpv/forgotten-export
Add forgotten export for quitcd scripts
-rw-r--r--misc/quitcd/quitcd.bash2
-rw-r--r--misc/quitcd/quitcd.fish11
-rw-r--r--misc/quitcd/quitcd.zsh2
3 files changed, 9 insertions, 6 deletions
diff --git a/misc/quitcd/quitcd.bash b/misc/quitcd/quitcd.bash
index 15b9f42..e303b4c 100644
--- a/misc/quitcd/quitcd.bash
+++ b/misc/quitcd/quitcd.bash
@@ -1,6 +1,6 @@
n()
{
- NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
+ export NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
nnn "$@"
diff --git a/misc/quitcd/quitcd.fish b/misc/quitcd/quitcd.fish
index 7bc67fe..f2a54e8 100644
--- a/misc/quitcd/quitcd.fish
+++ b/misc/quitcd/quitcd.fish
@@ -3,13 +3,16 @@
# or, add the lines to the 'config.fish' file.
function n --description 'support nnn quit and change directory'
- # NOTE: set NNN_TMPFILE correctly if you use 'XDG_CONFIG_HOME'
- set NNN_TMPFILE ~/.config/nnn/.lastd
+ if test -n "$XDG_CONFIG_HOME"
+ set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
+ else
+ set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
+ end
nnn $argv
if test -e $NNN_TMPFILE
- source $NNN_TMPFILE
- rm $NNN_TMPFILE
+ source $NNN_TMPFILE
+ rm $NNN_TMPFILE
end
end
diff --git a/misc/quitcd/quitcd.zsh b/misc/quitcd/quitcd.zsh
index 207aa56..c55b321 100644
--- a/misc/quitcd/quitcd.zsh
+++ b/misc/quitcd/quitcd.zsh
@@ -1,6 +1,6 @@
n()
{
- NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
+ export NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
nnn "$@"