diff options
| author | LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> | 2023-07-31 19:19:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-31 17:19:21 +0000 |
| commit | 8b05b15355f47009cc6cf17917fcc5cf88b8b493 (patch) | |
| tree | 7b22656089b7828921c700f9f57d806f2cd231b8 | |
| parent | fix(server): Teapot is a cup of coffee (#1137) (diff) | |
| download | atuin-8b05b15355f47009cc6cf17917fcc5cf88b8b493.zip | |
fix: nushell empty hooks (#1138)
Co-authored-by: Andrea Jemmett <1787979+acidghost@users.noreply.github.com>
| -rw-r--r-- | atuin/src/shell/atuin.nu | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/atuin/src/shell/atuin.nu b/atuin/src/shell/atuin.nu index f86636cc..33ce0068 100644 --- a/atuin/src/shell/atuin.nu +++ b/atuin/src/shell/atuin.nu @@ -35,10 +35,14 @@ def _atuin_search_cmd [...flags: string] { ] | str join "\n" } +$env.config = ($env | default {} config).config +$env.config = ($env.config | default {} hooks) $env.config = ( $env.config | upsert hooks ( $env.config.hooks - | upsert pre_execution ($env.config.hooks.pre_execution | append $_atuin_pre_execution) - | upsert pre_prompt ($env.config.hooks.pre_prompt | append $_atuin_pre_prompt) + | upsert pre_execution ( + $env.config.hooks | get -i pre_execution | default [] | append $_atuin_pre_execution) + | upsert pre_prompt ( + $env.config.hooks | get -i pre_prompt | default [] | append $_atuin_pre_prompt) ) ) |
