direnv hook "cannot find column 'PWD'"
I am nu to nushell, and am trying to integrate direnv in the config.
I have copied the hooks to the correct config path, however when I launch my terminal and nushell I get the following error:
22 │ $env.config.hooks.env_change.PWD = (
23 │ $env.config.hooks.env_change.PWD | append (source nu-hooks/nu-hooks/direnv/config.nu)
· ─┬─
· ╰── cannot find column 'PWD'
24 │ )
I thought that PWD was supposed to automatically be set, and manually trying to set is in config throws and error that it can't be set manually.
How am I supposed to add this hook to my config so that PWD column is available?
Thanks for the help.
using this config fixed the same issue for me
$env.config = {
hooks: {
env_change: {
PWD: (
$env.config.hooks.env_change.PWD? | default []
| append {||
if (which direnv | is-empty) {
return
}
direnv export json | from json | default {} | load-env
}
)
}
}
}
Ya, I ended up using that from website as well, but it had suggested using nu-hooks scripts in repo for latest version. That is what doesn't seem to work.