mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-30 13:47:46 +00:00
Fix error in non-home paths (#1129)
Before it would fail in paths outside the home directory with ``` × Pipeline empty. ╭─[/home/filipp/.config/nushell/panache-git.nu:32:76] 31 │ let current_dir_relative_to_home = ( 32 │ do --ignore-errors { $current_dir | path relative-to $nu.home-path } | str join · ────┬─── · ╰── no input value was piped in 33 │ ) ╰──── ```
This commit is contained in:
parent
6fe7713322
commit
2e39c27560
1 changed files with 1 additions and 1 deletions
|
@ -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 } | str join
|
||||
do --ignore-errors { $current_dir | path relative-to $nu.home-path | str join }
|
||||
)
|
||||
|
||||
let in_sub_dir_of_home = ($current_dir_relative_to_home | is-not-empty)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue