Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Update Nushell integration (#46)
Browse files Browse the repository at this point in the history
* Update Nushell integration

Depends on jdx/mise#1763 in release.

* Automate reinstallation

Manually picked from starship/starship#5845.
  • Loading branch information
texastoland committed Mar 22, 2024
1 parent 3de277a commit 12b0557
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,26 @@ See [`MISE_FISH_AUTO_ACTIVATE=1`](/configuration#mise_fish_auto_activate1) for m

#### Nushell

Since Nu does [not support `eval`](https://www.nushell.sh/book/how_nushell_code_gets_run.html#eval-function) the initialization script is saved in `env.nu`:

```nushell
'
let mise_path = $nu.default-config-dir | path join scripts mise.nu
if $nu.is-interactive {
^mise activate nu | save $mise_path --force
}' | save $nu.env-path --append
'
if $nu.is-interactive {
use mise.nu
}' | save $nu.config-path --append
```

If you prefer to keep your dotfiles clean you can save it to a different directory then update `$env.NU_LIB_DIRS`:

```nushell
do {
let misepath = ($nu.config-path | path dirname | path join "mise.nu")
run-external mise activate nu --redirect-stdout | save $misepath -f
$"\nsource "($misepath)"" | save $nu.config-path --append
}
'
$env.NU_LIB_DIRS ++= ($mise_path | path dirname | to nuon)
' | save $nu.env-path --append
```

#### Xonsh
Expand Down

0 comments on commit 12b0557

Please sign in to comment.