]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix paths in nushell quitcd script
authorHenri Bourcereau <henri.bourcereau@gmail.com>
Tue, 7 Mar 2023 14:40:10 +0000 (15:40 +0100)
committerGitHub <noreply@github.com>
Tue, 7 Mar 2023 14:40:10 +0000 (15:40 +0100)
This set the correct path to the temp nnn file when XDG_CONFIG_HOME is set. It fixes https://github.com/jarun/nnn/discussions/1605

misc/quitcd/quitcd.nu

index f291e5a7d4cbbb21fcc5c2722d51edc6907d65ce..f89acb728929c64d06a2f44dbd7afb38f81d3da7 100644 (file)
@@ -1,6 +1,6 @@
 # The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
-let cfgHome = ($env | default $env.HOME XDG_CONFIG_HOME | get XDG_CONFIG_HOME)
-let-env NNN_TMPFILE = $"($cfgHome)/.config/nnn/.lastd"
+let cfgHome = ($env | default $"($env.HOME)/.config" XDG_CONFIG_HOME | get XDG_CONFIG_HOME)
+let-env NNN_TMPFILE = $"($cfgHome)/nnn/.lastd"
 
 def-env n [...x] {
   # Launch nnn. Add desired flags after `^nnn`, ex: `^nnn -eda ($x | str join)`