1
Fork 0
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:
Darren Schroeder 2023-08-17 18:10:20 -05:00 committed by GitHub
parent dd499c916f
commit 8e086d8771
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 13 deletions

View file

@ -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 '\\' '/'
}
}