Skip to content

Commit

Permalink
Implement maintainer feedback
Browse files Browse the repository at this point in the history
Reinitializes the script at most once every day. This is necessary because doing so every
time could lead to thousands of concurrent writes calling `| par-each { nu -c }`.
  • Loading branch information
texastoland committed Mar 17, 2024
1 parent d7e95cd commit ade338e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,18 @@ description: Starship is the minimal, blazing fast, and extremely customizable p

#### Nushell

Since Nu does [not support `eval`](https://www.nushell.sh/book/how_nushell_code_gets_run.html#eval-function) you must save the initialization 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 starship_path = $nu.default-config-dir | path join scripts starship.nu
starship init nu | save $starship_path --force
if not (
$starship_path | path exists
) or (
(date now) - (ls $starship_path).modified.0 > 1day
) {
starship init nu | save $starship_path --force
}' | save $nu.env-path --append
"\nuse starship.nu" | save $nu.config-path --append
```

Expand All @@ -151,12 +158,6 @@ description: Starship is the minimal, blazing fast, and extremely customizable p
"\n$env.NU_LIB_DIRS ++= ($starship_path | path dirname | to nuon)" | save $nu.env-path --append
```

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

```nushell
starship init nu | save $starship_path --force
```

#### Xonsh

Add the following to the end of `~/.xonshrc`:
Expand Down

0 comments on commit ade338e

Please sign in to comment.