Skip to content

Commit 61d0b68

Browse files
authored
Update hooks.md
Fixing example by adding `[` and `]` to provide list to hook ``` Error: nu::shell::invalid_config × Encountered 1 error(s) when updating config Error: nu::shell::type_mismatch × Type mismatch at $env.config.hooks.env_change.PWD ╭─[] 4 │ env_change: { 5 │ ╭─▶ PWD: { 6 │ │ code: 'print $"changing directory from ($before) to ($after)"' 7 │ ├─▶ } · ╰──── expected list<any>, but got record<code: string> 8 │ } ╰──── ```
1 parent b71d260 commit 61d0b68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/hooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ When defining a hook as a string, the `$before` and `$after` variables are set t
188188
```nu
189189
$env.config = ($env.config | upsert hooks {
190190
env_change: {
191-
PWD: {
191+
PWD: [{
192192
code: 'print $"changing directory from ($before) to ($after)"'
193-
}
193+
}]
194194
}
195195
})
196196
```

0 commit comments

Comments
 (0)