Dotfiles/site-modules/core/files/nushell/scripts/path.nu
Ade Attwood 42cbeed7de fix(nu): support windows nicely
The main thing we are doing is setting the `HOME` and `USER` env variables so
we can use comon variables over linux and windows.

There is also a windows wezterm issue `shell_integration.osc133` feature needs
to be disabled. This will stop the prompt adding a new line on every char typed
into the prompt.
2025-07-25 09:03:11 +01:00

22 lines
469 B
Text

export-env {
$env.GOPATH = if ($env.COMPUTERNAME == "LAFITE") {
$"D:/Code"
} else {
$"($env.HOME)/Code"
}
$env.PATH = $env.PATH
| prepend ([$env.HOME ".cargo" "bin"] | path join)
}
export def --env node-modules-dir-hook [dir: string] {
let nodePath = ([$dir, "node_modules", ".bin"] | path join)
if ($nodePath | path exists) {
$env.PATH = $env.PATH
| where {|x| not ($x | str contains "node_modules")}
| prepend $nodePath
}
}