From 844f54171968caa28b1c25ee0b4119ea2571ea35 Mon Sep 17 00:00:00 2001 From: Mach50 <64970593+MasterMach50@users.noreply.github.com> Date: Sat, 2 Sep 2023 19:30:10 +0530 Subject: [PATCH] changed default env file to use $nu.home_path to find home (#10192) # Description Changed the default env file so that home is found using `$nu.home-path` instead to using an if-else statement to find the os then find the specific environment variable --- crates/nu-utils/src/sample_config/default_env.nu | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crates/nu-utils/src/sample_config/default_env.nu b/crates/nu-utils/src/sample_config/default_env.nu index 7986f193e6..c5c5578aab 100644 --- a/crates/nu-utils/src/sample_config/default_env.nu +++ b/crates/nu-utils/src/sample_config/default_env.nu @@ -3,14 +3,7 @@ # version = "0.84.1" def create_left_prompt [] { - mut home = "" - try { - if $nu.os-info.name == "windows" { - $home = $env.USERPROFILE - } else { - $home = $env.HOME - } - } + let home = $nu.home-path let dir = ([ ($env.PWD | str substring 0..($home | str length) | str replace $home "~"),