direnv: fix nushell syntax

With nushell `0.85.0` this is no longer valid syntax. This change fixes
the syntax error with `0.85.0` while still remaining valid for `0.84.0`
and earlier.
This commit is contained in:
Chris Dawkins 2023-09-23 16:56:48 -06:00 committed by GitHub
parent 7413408b04
commit 2d27bdcd64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,7 +134,7 @@ in {
$env.config = ($env.config | update hooks.pre_prompt ($env.config.hooks.pre_prompt | append {
code: "
let direnv = (${pkgs.direnv}/bin/direnv export json | from json)
let direnv = if ($direnv | length) == 1 { $direnv } else { {} }
let direnv = if not ($direnv | is-empty) { $direnv } else { {} }
$direnv | load-env
"
}))