mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 14:47:47 +00:00
update prompts scripts with new str replace
syntax (#579)
This commit is contained in:
parent
dd499c916f
commit
8e086d8771
5 changed files with 13 additions and 13 deletions
|
@ -240,14 +240,14 @@ def home_abbrev [os_name] {
|
|||
let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
|
||||
if $is_home_in_path {
|
||||
if ($os_name == "windows") {
|
||||
let home = ($nu.home-path | str replace -a '\\' '/')
|
||||
let pwd = ($env.PWD | str replace -a '\\' '/')
|
||||
let home = ($nu.home-path | str replace -ar '\\' '/')
|
||||
let pwd = ($env.PWD | str replace -ar '\\' '/')
|
||||
$pwd | str replace $home '~'
|
||||
} else {
|
||||
$env.PWD | str replace $nu.home-path '~'
|
||||
}
|
||||
} else {
|
||||
$env.PWD | str replace -a '\\' '/'
|
||||
$env.PWD | str replace -ar '\\' '/'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue