Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/cwdhist/mod.nu
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export-env {
}

let __cwdhist_hook = {|_, dir|
if $dir == $nu.home-path { return }
let suffix = (do --ignore-errors { $dir | path relative-to $nu.home-path })
if $dir == $nu.home-dir { return }
let suffix = (do --ignore-errors { $dir | path relative-to $nu.home-dir })
let path = if ($suffix | is-empty) {
$dir
} else {
Expand Down
4 changes: 2 additions & 2 deletions modules/prompt/jalon-git.nu
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ def current-dir-style [] {
let s = get-styles
let current_dir = ($env.PWD)

let current_dir_abbreviated = if $current_dir == $nu.home-path {
let current_dir_abbreviated = if $current_dir == $nu.home-dir {
'~'
} else {
let current_dir_relative_to_home = (
do --ignore-errors { $current_dir | path relative-to $nu.home-path } | str join
do --ignore-errors { $current_dir | path relative-to $nu.home-dir } | str join
)

if ($current_dir_relative_to_home | is-empty) == false {
Expand Down
4 changes: 2 additions & 2 deletions modules/prompt/left_and_right_prompt.nu
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export def construct_prompt [] {

# Abbreviate home path
def home_abbrev [] {
let is_home_in_path = (pwd | into string | str starts-with $nu.home-path)
let is_home_in_path = (pwd | into string | str starts-with $nu.home-dir)
if $is_home_in_path {
let lin_home = ($nu.home-path | into string | str replace -a '\\' '/' | str downcase)
let lin_home = ($nu.home-dir | into string | str replace -a '\\' '/' | str downcase)
let lin_pwd = (pwd | into string | str replace -a '\\' '/' | str downcase)
$lin_pwd | str replace $lin_home '~'
} else {
Expand Down
10 changes: 5 additions & 5 deletions modules/prompt/oh-my-minimal.nu
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

# Abbreviate home path
def home_abbrev [os] {
let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
let is_home_in_path = ($env.PWD | str starts-with $nu.home-dir)
if ($is_home_in_path == true) {
if ($os == "windows") {
let home = ($nu.home-path | str replace -ar '\\' '/')
let home = ($nu.home-dir | str replace -ar '\\' '/')
let pwd = ($env.PWD | str replace -ar '\\' '/')
$pwd | str replace $home '~'
} else {
$env.PWD | str replace $nu.home-path '~'
$env.PWD | str replace $nu.home-dir '~'
}
} else {
$env.PWD | str replace -ar '\\' '/'
Expand All @@ -42,7 +42,7 @@ export def path_abbrev_if_needed [apath term_width] {
let red = (ansi red)

# replace the home path first
let apath = ($apath | str replace $nu.home-path ~)
let apath = ($apath | str replace $nu.home-dir ~)
# split out by path separator into tokens
# don't use psep here because in home_abbrev we're making them all '/'
let splits = ($apath | split row '/')
Expand Down Expand Up @@ -144,7 +144,7 @@ export def get_left_prompt [os use_nerd_fonts] {
(char space) # space
] | str join)

let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
let is_home_in_path = ($env.PWD | str starts-with $nu.home-dir)
let path_segment = (if $is_home_in_path {
[
(if $use_nerd_fonts {
Expand Down
8 changes: 4 additions & 4 deletions modules/prompt/oh-my-v2.nu
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ def get_color [name, mode] {

# Abbreviate home path for the prompt
def home_abbrev [os_name] {
let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
let is_home_in_path = ($env.PWD | str starts-with $nu.home-dir)
if $is_home_in_path {
if ($os_name == "windows") {
let home = ($nu.home-path | str replace -ar '\\' '/')
let home = ($nu.home-dir | str replace -ar '\\' '/')
let pwd = ($env.PWD | str replace -ar '\\' '/')
$pwd | str replace $home '~'
} else {
$env.PWD | str replace $nu.home-path '~'
$env.PWD | str replace $nu.home-dir '~'
}
} else {
$env.PWD | str replace -ar '\\' '/'
Expand Down Expand Up @@ -296,7 +296,7 @@ def get_os_segment [os color_mode] {
# get the path segment for the prompt
def get_path_segment [os color_mode] {
let display_path = (home_abbrev $os.name)
let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
let is_home_in_path = ($env.PWD | str starts-with $nu.home-dir)
let pwd_bg_color = (get_color pwd_bg_color $color_mode)
let pwd_color = (get_color pwd_color_dirs $color_mode)
let home_or_folder = (if $is_home_in_path { (char nf_house1) } else { (char nf_folder1) })
Expand Down
2 changes: 1 addition & 1 deletion modules/prompt/panache-git.nu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export def current-dir [] {
let current_dir = ($env.PWD)

let current_dir_relative_to_home = (
do --ignore-errors { $current_dir | path relative-to $nu.home-path }
do --ignore-errors { $current_dir | path relative-to $nu.home-dir }
)

let in_sub_dir_of_home = ($current_dir_relative_to_home | is-not-empty)
Expand Down
2 changes: 1 addition & 1 deletion modules/prompt/powerline/power.nu
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export def "pwd_abbr" [] {
{|bg|
let pwd = ($env.PWD)

let to_home = (related $pwd $nu.home-path)
let to_home = (related $pwd $nu.home-dir)

let cwd = if $to_home.related == '=' {
"~"
Expand Down
2 changes: 1 addition & 1 deletion modules/zvm/zvm.nu
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def verify_signature [temp_dir: string, tarball: string] {
}

def get_or_create_path_prefix [] {
let path_prefix = $"($nu.home-path)/.local/share/zvm"
let path_prefix = $"($nu.home-dir)/.local/share/zvm"
if not ($path_prefix | path exists) { mkdir $path_prefix }
$path_prefix
}
Expand Down
2 changes: 1 addition & 1 deletion sourced/cool-oneliners/pwd-short.nu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Print working directory but abbreviates the home dir as ~
def pwd-short [] {
$env.PWD | str replace $nu.home-path '~'
$env.PWD | str replace $nu.home-dir '~'
}
2 changes: 1 addition & 1 deletion sourced/misc/nu_defs.nu
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def column2 [n] {

#short pwd
def pwd-short [] {
$env.PWD | str replace $nu.home-path '~'
$env.PWD | str replace $nu.home-dir '~'
}

#string repeat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Examples:
# Set $env.NUPM_HOME
# > set-env NUPM_HOME $'($nu.home-path)/.local/share/nupm'
# > set-env NUPM_HOME $'($nu.home-dir)/.local/share/nupm'
#
# Add to $env.NU_LIB_DIRS
# > set-env --append NU_LIB_DIRS $'($env.NUPM_HOME)/modules'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export def 'test glob' [] {
}

def test [expects: list<string> command: closure] {
let test_dir = $nu.temp-path | path join (random uuid)
let test_dir = $nu.temp-dir | path join (random uuid)
def actual-files [] {
ls --all --short-names $test_dir | get name | sort
}
Expand Down
Loading