1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-30 13:47:46 +00:00

Support configs with no hooks in rusty-paths.nu (#1096)

Use upsert instead of update to support configurations without PWD-env
hooks (the default)
This commit is contained in:
Jan Klass 2025-04-21 13:13:31 +02:00 committed by GitHub
parent c62a46d6e3
commit 4f54b1ab9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: {