-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
/ref 61662e8 setup-util-nu: fix self-load infinite loop with defaults 1a735c7 setup-util-nu/starship.nu: fixed and improved starship theme setup ab2d6ad dorothy-workflow.yml: implement workaround for -l not loading login.nu b653506
- Loading branch information
Showing
3 changed files
with
25 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
#!/usr/bin/env nu | ||
|
||
# ensure starship | ||
mut reload_required_for_starship = false | ||
command-exists 'starship' | complete | ||
if $env.LAST_EXIT_CODE == 0 { | ||
if $env.LAST_EXIT_CODE != 0 { | ||
# starship is missing, install it | ||
setup-util-starship --quiet | ||
$reload_required_for_starship = true | ||
} | ||
if ( open ~/.local/state/starship/init.nu | length ) == 0 { | ||
# init script is placeholder, update it | ||
starship init nu | save --force ~/.local/state/starship/init.nu | ||
$reload_required_for_starship = true | ||
} | ||
if $reload_required_for_starship == true { | ||
# reload the shell to ensure starship is loaded | ||
echo-style --notice='Starship installed, reload your terminal.' | ||
exit 35 # EAGAIN 35 Resource temporarily unavailable | ||
} | ||
|
||
# ensure starship nushell <-- no point, as nushell requires everything to already be as intended at compile-time | ||
# if ( ~/.local/state/starship/init.nu | path exists ) == false { | ||
# mkdir ~/.local/state/starship | ||
# starship init nu | save ~/.local/state/starship/init.nu | ||
# fi | ||
|
||
# load starship nushell | ||
# load the actual starship init script | ||
use ~/.local/state/starship/init.nu |