Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nushell integration after nushell language change #1610

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions asdf.nu
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
def-env configure-asdf [] {
let ASDF_DIR = ($env.HOME | path join ".asdf")

let-env ASDF_DIR = ( if ( $env | get --ignore-errors ASDF_DIR | is-empty ) { $env.ASDF_NU_DIR } else { $env.ASDF_DIR } )

let shims_dir = ( if ( $env | get --ignore-errors ASDF_DATA_DIR | is-empty ) { $env.HOME | path join '.asdf' } else { $env.ASDF_DIR } | path join 'shims' )

let asdf_bin_dir = ( $env.ASDF_DIR | path join 'bin' )


let-env PATH = ( $env.PATH | split row (char esep) | where { |p| $p != $shims_dir } | prepend $shims_dir )
let-env PATH = ( $env.PATH | split row (char esep) | where { |p| $p != $asdf_bin_dir } | prepend $asdf_bin_dir )
## Binary
let BIN_DIR = ($ASDF_DIR | path join "bin")
$env.PATH = ($env.PATH | where { |p| $p != $BIN_DIR } | append $BIN_DIR)

## Shims
let SHIMS_DIR = ($ASDF_DIR | path join "shims")
$env.PATH = ($env.PATH | where { |p| $p != $SHIMS_DIR } | append $SHIMS_DIR)
}

configure-asdf
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ Add the following to `~/.config/powershell/profile.ps1`:
Add `asdf.nu` to your `~/.config/nushell/config.nu` with:

```shell
"\nlet-env ASDF_NU_DIR = ($env.HOME | path join '.asdf')\n source " + ($env.HOME | path join '.asdf/asdf.nu') | save --append $nu.config-path
source "/home/$HOME/.asdf/asdf.nu"
```

Completions are automatically configured
Remember to change `$HOME` to your username. Completions are automatically configured.
:::

::: details Nushell & Homebrew
Expand Down
4 changes: 2 additions & 2 deletions docs/pt-br/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ Adicione a seguinte linha ao seu `~/.config/powershell/profile.ps1`:
Adicione `asdf.nu` ao seu `~/.config/nushell/config.nu` através do comando:

```shell
"\nlet-env ASDF_NU_DIR = ($env.HOME | path join '.asdf')\n source " + ($env.HOME | path join '.asdf/asdf.nu') | save --append $nu.config-path
source "/home/$HOME/.asdf/asdf.nu"
```

Ao concluir atualizará automaticamente
Lembre-se de modificiar `$HOME` para seu nome de usuário. O autocomplete já vem configurado.
:::

::: details Nushell & Homebrew
Expand Down
Loading