Skip to content

Commit efa0c9f

Browse files
authored
Fix hooks.md typos (nushell#1887)
1 parent 509198d commit efa0c9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

book/hooks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Hooks
22

33
Hooks allow you to run a code snippet at some predefined situations.
4-
They are only available in the interactive mode ([REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)), they do not work if you run a Nushell with a script (`nu script.nu`) or commands (`nu -c "print foo"`) arguments.
4+
They are only available in the interactive mode ([REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)), they do not work if you run Nushell with a script (`nu script.nu`) or command (`nu -c "print foo"`) argument.
55

66
Currently, we support these types of hooks:
77

@@ -41,7 +41,7 @@ $env.config = {
4141
}
4242
```
4343

44-
Try putting the above to your config, running Nushell and moving around your filesystem.
44+
Try putting the above into your config, running Nushell and moving around your filesystem.
4545
When you change a directory, the `PWD` environment variable changes and the change triggers the hook with the previous and the current values stored in `before` and `after` variables, respectively.
4646

4747
Instead of defining just a single hook per trigger, it is possible to define a **list of hooks** which will run in sequence:
@@ -119,7 +119,7 @@ $env.config = ($env.config | upsert hooks {
119119
This won't work because the environment will be active only within the [`if`](/commands/docs/if.md) block.
120120
In this case, you could easily rewrite it as `load-env (if $after == ... { ... } else { {} })` but this pattern is fairly common and later we'll see that not all cases can be rewritten like this.
121121

122-
To deal with the above problem, we introduce another way to define a hook -- **a record**:
122+
To deal with the above problem, we introduce another way to define a hook - **a record**:
123123

124124
```nu
125125
$env.config = ($env.config | upsert hooks {

0 commit comments

Comments
 (0)