17 lines
390 B
Text
17 lines
390 B
Text
export-env {
|
|
$env.config = ( $env.config | upsert hooks.env_change.PWD { |config|
|
|
let o = ($config | get -i hooks.env_change.PWD)
|
|
let val = { ||
|
|
if (which direnv | is-empty) {
|
|
return
|
|
}
|
|
|
|
direnv export json | from json | default {} | load-env
|
|
}
|
|
if $o == null {
|
|
$val
|
|
} else {
|
|
$o | append $val
|
|
}
|
|
})
|
|
}
|