We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8398287 commit cea99ebCopy full SHA for cea99eb
nu-hooks/nu-hooks/direnv/config.nu
@@ -24,5 +24,6 @@
24
25
direnv export json | from json | default {} | load-env
26
# Direnv outputs $PATH as a string, but nushell silently breaks if isn't a list-like table.
27
- $env.PATH = $env.PATH | split row (char env_sep)
+ # The following behemoth of Nu code turns this into nu's format while following the standards of how to handle quotes
28
+ $env.PATH = $env.PATH | parse --regex ('' + `((?:(?:"(?:(?:\\[\\"])|.)*?")|(?:'.*?')|[^` + (char env_sep) + `]*)*)`) | each {|x| $x.capture0 | parse --regex `(?:"((?:(?:\\"|.))*?)")|(?:'(.*?)')|([^'"]*)` | each {|y| if ($y.capture0 != "") { $y.capture0 | str replace -ar `\\([\\"])` `$1` } else if ($y.capture1 != "") { $y.capture1 } else $y.capture2 } | str join }
29
}
0 commit comments