1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-31 14:17:45 +00:00
nu_scripts/modules/rbenv/rbenv.nu
Zh_Jk d316685063
Update rbenv module (#1007)
heres the changes

- Removed outdated code
- Replaced the old load-env with $env assignment
- Kept the rbenv command intact but focused on the "rbenv shell"
(modified a subcommand rather than the whole command)
- Deleted unused command completions
2025-01-01 08:15:40 -06:00

19 lines
473 B
Text

# rbenv
export-env {
use std/util "path add"
$env.RBENV_SHELL = 'nu'
$env.RBENV_VERSION = ''
path add $"($env.HOME)/.rbenv/bin"
path add $"($env.HOME)/.rbenv/shims"
}
export def --env "shell" [version: string] {
let run = (^rbenv sh-shell $version | complete)
if ($run.exit_code == 0) {
$env.RBENV_VERSION_OLD = ($env.RBENV_VERSION | default "")
$env.RBENV_VERSION = $version
} else {
print -e $run.stderr
}
}