mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
direnv: work around nushell bug
try/catch in a pipeline does not always work correctly in 0.98, so avoid the try-catch entirely. Upstream issue: https://github.com/nushell/nushell/issues/13868
This commit is contained in:
parent
c124568e10
commit
57e6b30d18
2 changed files with 7 additions and 8 deletions
|
@ -141,12 +141,12 @@ in {
|
||||||
| default []
|
| default []
|
||||||
| append {||
|
| append {||
|
||||||
let direnv = (
|
let direnv = (
|
||||||
try {
|
# We want to get the stdout from direnv even if it exits with non-zero,
|
||||||
${getExe cfg.package} export json
|
# because it will have the DIRENV_ internal variables defined.
|
||||||
} catch {
|
do { ${getExe cfg.package} export json }
|
||||||
""
|
| complete
|
||||||
}
|
| get stdout
|
||||||
| from json
|
| from json --strict
|
||||||
| default {}
|
| default {}
|
||||||
)
|
)
|
||||||
if ($direnv | is-empty) {
|
if ($direnv | is-empty) {
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
"home-files/.config/nushell/config.nu";
|
"home-files/.config/nushell/config.nu";
|
||||||
in ''
|
in ''
|
||||||
assertFileExists "${configFile}"
|
assertFileExists "${configFile}"
|
||||||
assertFileRegex "${configFile}" \
|
assertFileRegex "${configFile}" '/nix/store/.*direnv.*/bin/direnv export json'
|
||||||
'^\s*/nix/store/.*direnv.*/bin/direnv export json$'
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue