Skip to content

Commit 33ea2a5

Browse files
jasha-hrpclaude
andauthored
Update nushell paths to reflect recent breaking changes (#1234)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c2e4b17 commit 33ea2a5

File tree

12 files changed

+22
-22
lines changed

12 files changed

+22
-22
lines changed

modules/cwdhist/mod.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export-env {
8686
}
8787

8888
let __cwdhist_hook = {|_, dir|
89-
if $dir == $nu.home-path { return }
90-
let suffix = (do --ignore-errors { $dir | path relative-to $nu.home-path })
89+
if $dir == $nu.home-dir { return }
90+
let suffix = (do --ignore-errors { $dir | path relative-to $nu.home-dir })
9191
let path = if ($suffix | is-empty) {
9292
$dir
9393
} else {

modules/prompt/jalon-git.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ def current-dir-style [] {
111111
let s = get-styles
112112
let current_dir = ($env.PWD)
113113

114-
let current_dir_abbreviated = if $current_dir == $nu.home-path {
114+
let current_dir_abbreviated = if $current_dir == $nu.home-dir {
115115
'~'
116116
} else {
117117
let current_dir_relative_to_home = (
118-
do --ignore-errors { $current_dir | path relative-to $nu.home-path } | str join
118+
do --ignore-errors { $current_dir | path relative-to $nu.home-dir } | str join
119119
)
120120

121121
if ($current_dir_relative_to_home | is-empty) == false {

modules/prompt/left_and_right_prompt.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ export def construct_prompt [] {
5353

5454
# Abbreviate home path
5555
def home_abbrev [] {
56-
let is_home_in_path = (pwd | into string | str starts-with $nu.home-path)
56+
let is_home_in_path = (pwd | into string | str starts-with $nu.home-dir)
5757
if $is_home_in_path {
58-
let lin_home = ($nu.home-path | into string | str replace -a '\\' '/' | str downcase)
58+
let lin_home = ($nu.home-dir | into string | str replace -a '\\' '/' | str downcase)
5959
let lin_pwd = (pwd | into string | str replace -a '\\' '/' | str downcase)
6060
$lin_pwd | str replace $lin_home '~'
6161
} else {

modules/prompt/oh-my-minimal.nu

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
# Abbreviate home path
1919
def home_abbrev [os] {
20-
let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
20+
let is_home_in_path = ($env.PWD | str starts-with $nu.home-dir)
2121
if ($is_home_in_path == true) {
2222
if ($os == "windows") {
23-
let home = ($nu.home-path | str replace -ar '\\' '/')
23+
let home = ($nu.home-dir | str replace -ar '\\' '/')
2424
let pwd = ($env.PWD | str replace -ar '\\' '/')
2525
$pwd | str replace $home '~'
2626
} else {
27-
$env.PWD | str replace $nu.home-path '~'
27+
$env.PWD | str replace $nu.home-dir '~'
2828
}
2929
} else {
3030
$env.PWD | str replace -ar '\\' '/'
@@ -42,7 +42,7 @@ export def path_abbrev_if_needed [apath term_width] {
4242
let red = (ansi red)
4343

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

147-
let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
147+
let is_home_in_path = ($env.PWD | str starts-with $nu.home-dir)
148148
let path_segment = (if $is_home_in_path {
149149
[
150150
(if $use_nerd_fonts {

modules/prompt/oh-my-v2.nu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@ def get_color [name, mode] {
237237

238238
# Abbreviate home path for the prompt
239239
def home_abbrev [os_name] {
240-
let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
240+
let is_home_in_path = ($env.PWD | str starts-with $nu.home-dir)
241241
if $is_home_in_path {
242242
if ($os_name == "windows") {
243-
let home = ($nu.home-path | str replace -ar '\\' '/')
243+
let home = ($nu.home-dir | str replace -ar '\\' '/')
244244
let pwd = ($env.PWD | str replace -ar '\\' '/')
245245
$pwd | str replace $home '~'
246246
} else {
247-
$env.PWD | str replace $nu.home-path '~'
247+
$env.PWD | str replace $nu.home-dir '~'
248248
}
249249
} else {
250250
$env.PWD | str replace -ar '\\' '/'
@@ -296,7 +296,7 @@ def get_os_segment [os color_mode] {
296296
# get the path segment for the prompt
297297
def get_path_segment [os color_mode] {
298298
let display_path = (home_abbrev $os.name)
299-
let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
299+
let is_home_in_path = ($env.PWD | str starts-with $nu.home-dir)
300300
let pwd_bg_color = (get_color pwd_bg_color $color_mode)
301301
let pwd_color = (get_color pwd_color_dirs $color_mode)
302302
let home_or_folder = (if $is_home_in_path { (char nf_house1) } else { (char nf_folder1) })

modules/prompt/panache-git.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export def current-dir [] {
2929
let current_dir = ($env.PWD)
3030

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

3535
let in_sub_dir_of_home = ($current_dir_relative_to_home | is-not-empty)

modules/prompt/powerline/power.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export def "pwd_abbr" [] {
1515
{|bg|
1616
let pwd = ($env.PWD)
1717

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

2020
let cwd = if $to_home.related == '=' {
2121
"~"

modules/zvm/zvm.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def verify_signature [temp_dir: string, tarball: string] {
156156
}
157157

158158
def get_or_create_path_prefix [] {
159-
let path_prefix = $"($nu.home-path)/.local/share/zvm"
159+
let path_prefix = $"($nu.home-dir)/.local/share/zvm"
160160
if not ($path_prefix | path exists) { mkdir $path_prefix }
161161
$path_prefix
162162
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Print working directory but abbreviates the home dir as ~
22
def pwd-short [] {
3-
$env.PWD | str replace $nu.home-path '~'
3+
$env.PWD | str replace $nu.home-dir '~'
44
}

sourced/misc/nu_defs.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def column2 [n] {
7575

7676
#short pwd
7777
def pwd-short [] {
78-
$env.PWD | str replace $nu.home-path '~'
78+
$env.PWD | str replace $nu.home-dir '~'
7979
}
8080

8181
#string repeat

0 commit comments

Comments
 (0)