From 03c80da8fd5152e3811b3ca522a884c959e44d9e Mon Sep 17 00:00:00 2001 From: Jasha Date: Mon, 9 Mar 2026 06:34:57 -0400 Subject: [PATCH] Update nushell paths to reflect recent breaking changes Co-Authored-By: Claude Sonnet 4.6 --- modules/cwdhist/mod.nu | 4 ++-- modules/prompt/jalon-git.nu | 4 ++-- modules/prompt/left_and_right_prompt.nu | 4 ++-- modules/prompt/oh-my-minimal.nu | 10 +++++----- modules/prompt/oh-my-v2.nu | 8 ++++---- modules/prompt/panache-git.nu | 2 +- modules/prompt/powerline/power.nu | 2 +- modules/zvm/zvm.nu | 2 +- sourced/cool-oneliners/pwd-short.nu | 2 +- sourced/misc/nu_defs.nu | 2 +- .../stdlib-candidate-older/std-rfc/set-env.nu | 2 +- .../stdlib-candidate-older/tests/bulk-rename.nu | 2 +- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/cwdhist/mod.nu b/modules/cwdhist/mod.nu index 6bfd1eec2..8c1b9946a 100644 --- a/modules/cwdhist/mod.nu +++ b/modules/cwdhist/mod.nu @@ -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 { diff --git a/modules/prompt/jalon-git.nu b/modules/prompt/jalon-git.nu index 32a393a2a..0dffde4c3 100644 --- a/modules/prompt/jalon-git.nu +++ b/modules/prompt/jalon-git.nu @@ -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 { diff --git a/modules/prompt/left_and_right_prompt.nu b/modules/prompt/left_and_right_prompt.nu index 0918871f0..a1bfb241d 100644 --- a/modules/prompt/left_and_right_prompt.nu +++ b/modules/prompt/left_and_right_prompt.nu @@ -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 { diff --git a/modules/prompt/oh-my-minimal.nu b/modules/prompt/oh-my-minimal.nu index af84069e9..6a9bb95f3 100644 --- a/modules/prompt/oh-my-minimal.nu +++ b/modules/prompt/oh-my-minimal.nu @@ -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 '\\' '/' @@ -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 '/') @@ -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 { diff --git a/modules/prompt/oh-my-v2.nu b/modules/prompt/oh-my-v2.nu index 24d588901..2eff5ac48 100644 --- a/modules/prompt/oh-my-v2.nu +++ b/modules/prompt/oh-my-v2.nu @@ -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 '\\' '/' @@ -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) }) diff --git a/modules/prompt/panache-git.nu b/modules/prompt/panache-git.nu index 96e929bef..03037823c 100644 --- a/modules/prompt/panache-git.nu +++ b/modules/prompt/panache-git.nu @@ -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) diff --git a/modules/prompt/powerline/power.nu b/modules/prompt/powerline/power.nu index 923d2e822..4f4855357 100644 --- a/modules/prompt/powerline/power.nu +++ b/modules/prompt/powerline/power.nu @@ -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 == '=' { "~" diff --git a/modules/zvm/zvm.nu b/modules/zvm/zvm.nu index f9b6e8e51..551f37778 100644 --- a/modules/zvm/zvm.nu +++ b/modules/zvm/zvm.nu @@ -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 } diff --git a/sourced/cool-oneliners/pwd-short.nu b/sourced/cool-oneliners/pwd-short.nu index 76fe0fcd1..24466e130 100644 --- a/sourced/cool-oneliners/pwd-short.nu +++ b/sourced/cool-oneliners/pwd-short.nu @@ -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 '~' } diff --git a/sourced/misc/nu_defs.nu b/sourced/misc/nu_defs.nu index 615292913..f3b0ddc21 100644 --- a/sourced/misc/nu_defs.nu +++ b/sourced/misc/nu_defs.nu @@ -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 diff --git a/stdlib-candidate-archive/stdlib-candidate-older/std-rfc/set-env.nu b/stdlib-candidate-archive/stdlib-candidate-older/std-rfc/set-env.nu index cf7f5a4e2..0dea2c341 100644 --- a/stdlib-candidate-archive/stdlib-candidate-older/std-rfc/set-env.nu +++ b/stdlib-candidate-archive/stdlib-candidate-older/std-rfc/set-env.nu @@ -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' diff --git a/stdlib-candidate-archive/stdlib-candidate-older/tests/bulk-rename.nu b/stdlib-candidate-archive/stdlib-candidate-older/tests/bulk-rename.nu index 7e46aae7e..e79f004b7 100644 --- a/stdlib-candidate-archive/stdlib-candidate-older/tests/bulk-rename.nu +++ b/stdlib-candidate-archive/stdlib-candidate-older/tests/bulk-rename.nu @@ -81,7 +81,7 @@ export def 'test glob' [] { } def test [expects: list 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 }