Comments (3)
Someone probably needs to update the code with the latest syntax.
from nu_scripts.
In what version was the new syntax implemented? Is there a migration guide?
from nu_scripts.
Is it something like this?
OLD:
# 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 rbenv [
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 }
}
NEW:
# 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"
}
}
def rbenv [command?: string, ...args] {
let new_env = if $command in ["rehash", "shell"] {
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 }
}
from nu_scripts.
Related Issues (20)
- Job.nu script no longer works HOT 2
- nu_conda list should show which environments are activated HOT 1
- Nuscript's for Pacman
- Add a basic level of CI for this repo HOT 3
- winget-completions.nu with problems? HOT 4
- Conda documentation HOT 3
- Admin commands Question HOT 1
- Fix: nushell at 0.88.0 `start` and `end` are deprecated HOT 1
- tokyo-night theme uses tokyo-storm palette HOT 7
- [new script] is dark_mode mac HOT 1
- The direnv hooks are very confusing HOT 1
- `main` branch CI is not working as expected HOT 1
- git branch cleanup returns errors. HOT 4
- PR 816 Broke Anaconda Activation Support on Windows
- 'winget show' errors on specific packages
- wrong syntax for accessing host name in `nu_conda_2/conda.nu` HOT 1
- Theme preview doesn't show "string" label when a closure is used in `color_config` HOT 6
- Winget completions does not work on too large number of rows HOT 1
- Remove pixi completions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nu_scripts.