From 4f54b1ab9a2fe474554bf5930152040fdb9f27aa Mon Sep 17 00:00:00 2001 From: Jan Klass Date: Mon, 21 Apr 2025 13:13:31 +0200 Subject: [PATCH] Support configs with no hooks in rusty-paths.nu (#1096) Use upsert instead of update to support configurations without PWD-env hooks (the default) --- nu-hooks/nu-hooks/rusty-paths/rusty-paths.nu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nu-hooks/nu-hooks/rusty-paths/rusty-paths.nu b/nu-hooks/nu-hooks/rusty-paths/rusty-paths.nu index 021dd02..097f5d2 100644 --- a/nu-hooks/nu-hooks/rusty-paths/rusty-paths.nu +++ b/nu-hooks/nu-hooks/rusty-paths/rusty-paths.nu @@ -10,7 +10,7 @@ # 2. Add `source rusty-paths.nu` to `$nu.config-path` -$env.config = ($env.config | update hooks.env_change.PWD { +$env.config = ($env.config | upsert hooks.env_change.PWD { append { condition: {|_, after| ($after | path join 'Cargo.lock' | path exists) } code: {