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

Commit

Permalink
Automate reinstallation
Browse files Browse the repository at this point in the history
Manually picked from starship/starship#5845.
  • Loading branch information
texastoland committed Mar 17, 2024
1 parent a63d3b9 commit b697209
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,26 +326,27 @@ 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) you must save the activation script:
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
^mise activate nu | save $mise_path --force
if not (
$mise_path | path exists
) or (
(date now) - (ls $mise_path).modified.0 > 1day
) {
^mise activate nu | save $mise_path --force
}' | save $nu.env-path --append
"\nuse mise.nu" | save $nu.config-path --append
```

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

```nushell
"\n$env.NU_LIB_DIRS ++= ($mise_path | path dirname | to nuon)" | save $nu.env-path --append
```

You can update the generated script at any time by re-running:

```nushell
^mise activate nu | save $mise_path --force
```

#### Xonsh

Since `.xsh` files are [not compiled](https://github.com/xonsh/xonsh/issues/3953) you may shave a bit off startup time by using a pure Python import: add the code below to, for example, `~/.config/xonsh/mise.py` config file and `import mise` it in `~/.config/xonsh/rc.xsh`:
Expand Down

0 comments on commit b697209

Please sign in to comment.