1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-30 21:57:44 +00:00

Fixed rusty-paths.nu entering into rust folder (#1115)

When starting a new shell session inside a rust folder you'd get this
error:


![image](https://github.com/user-attachments/assets/dd6ad06c-fc82-4a92-b0cd-18e41c1d3254)

This pr fixes this issue.

Entering a folder without having a previous folder happen when you for
example start a new terminal or starts a multiplexer already inside that
folder.
This commit is contained in:
TheCodeLamp 2025-05-05 12:33:58 +00:00 committed by GitHub
parent 54f10ee7ee
commit 4ecbb0e04e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,7 +23,7 @@ $env.config = ($env.config | upsert hooks.env_change.PWD {
}
}
| append {
condition: {|before, _| ($before | default '' | path join 'Cargo.lock' | path exists) }
condition: {|before, _| ($before | default '' | path join 'Cargo.lock' | path exists) and ($before | is-not-empty)}
code: {|before, _|
$env.PATH = (
$env.PATH