mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-31 14:17:45 +00:00

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
19 lines
473 B
Text
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
|
|
}
|
|
}
|