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 default-env after latest changes #10052

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/nu-utils/src/sample_config/default_env.nu
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ def create_left_prompt [] {
}

let dir = ([
($env.PWD | str substring 0..($home | str length) | str replace --string $home "~"),
($env.PWD | str substring 0..($home | str length) | str replace $home "~"),
($env.PWD | str substring ($home | str length)..)
] | str join)

let path_color = (if (is-admin) { ansi red_bold } else { ansi green_bold })
let separator_color = (if (is-admin) { ansi light_red_bold } else { ansi light_green_bold })
let path_segment = $"($path_color)($dir)"

$path_segment | str replace --all --string (char path_sep) $"($separator_color)/($path_color)"
$path_segment | str replace --all (char path_sep) $"($separator_color)/($path_color)"
}

def create_right_prompt [] {
Expand All @@ -30,8 +30,8 @@ def create_right_prompt [] {
(ansi reset)
(ansi magenta)
(date now | format date '%Y/%m/%d %r')
] | str join | str replace --all "([/:])" $"(ansi green)${1}(ansi magenta)" |
str replace --all "([AP]M)" $"(ansi magenta_underline)${1}")
] | str join | str replace --regex --all "([/:])" $"(ansi green)${1}(ansi magenta)" |
str replace --regex --all "([AP]M)" $"(ansi magenta_underline)${1}")

let last_exit_code = if ($env.LAST_EXIT_CODE != 0) {([
(ansi rb)
Expand Down