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
This commit is contained in:
Mach50 2023-09-02 19:30:10 +05:30 committed by GitHub
parent d28f728787
commit 844f541719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 "~"),