mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-02-26 09:58:03 +00:00
Changed . token to _dot
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
This commit is contained in:
10
dot_config/nushell/nu_scripts/modules/rbenv/README.md
Normal file
10
dot_config/nushell/nu_scripts/modules/rbenv/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# rbenv script
|
||||
|
||||
This script provides minimal working rbenv setup.
|
||||
It can be used by importing its exported commands via:
|
||||
|
||||
```
|
||||
use path/to/rbenv.nu *
|
||||
```
|
||||
|
||||
With `path/to` being either the relative path of the file to your current working directory or its absolute path.
|
||||
38
dot_config/nushell/nu_scripts/modules/rbenv/rbenv.nu
Normal file
38
dot_config/nushell/nu_scripts/modules/rbenv/rbenv.nu
Normal file
@@ -0,0 +1,38 @@
|
||||
# rbenv
|
||||
export-env {
|
||||
load-env {
|
||||
PATH: ($env.PATH | split row (char esep) | prepend [$"($env.HOME)/.rbenv/bin" $"($env.HOME)/.rbenv/shims"])
|
||||
RBENV_VERSION: ""
|
||||
RBENV_VERSION_OLD: ""
|
||||
RBENV_SHELL: "nu"
|
||||
}
|
||||
}
|
||||
|
||||
export def --env main [
|
||||
command?: string@'nu-complete rbenv',
|
||||
...args
|
||||
] {
|
||||
let new_env = if $command in ["rehash", "shell"] {
|
||||
# implement each on indiviudaly e.g.
|
||||
if $command == "shell" {
|
||||
{ RBENV_VERSION_OLD: $env.RBENV_VERSION RBENV_VERSION: $args.0 }
|
||||
} else {
|
||||
error make { msg: $"`($command)` command is not supported yet" }
|
||||
}
|
||||
} else {
|
||||
if ($command | is-empty) {
|
||||
^rbenv
|
||||
} else {
|
||||
^rbenv $command $args
|
||||
}
|
||||
{}
|
||||
}
|
||||
load-env $new_env
|
||||
}
|
||||
|
||||
def 'nu-complete rbenv' [] {
|
||||
^rbenv help
|
||||
| lines
|
||||
| where ($it | str starts-with " ")
|
||||
| each {|entry| $entry | split row ' ' | get 0 }
|
||||
}
|
||||
Reference in New Issue
Block a user