Skip to content

Commit 4ecbb0e

Browse files
authored
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.
1 parent 54f10ee commit 4ecbb0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nu-hooks/nu-hooks/rusty-paths/rusty-paths.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $env.config = ($env.config | upsert hooks.env_change.PWD {
2323
}
2424
}
2525
| append {
26-
condition: {|before, _| ($before | default '' | path join 'Cargo.lock' | path exists) }
26+
condition: {|before, _| ($before | default '' | path join 'Cargo.lock' | path exists) and ($before | is-not-empty)}
2727
code: {|before, _|
2828
$env.PATH = (
2929
$env.PATH

0 commit comments

Comments
 (0)