Skip to content

Commit

Permalink
fix: ensure dirs arent empty strings
Browse files Browse the repository at this point in the history
This fixes issue 564 also safely wraps strings for parsing

[564]
  • Loading branch information
nnungest committed Mar 6, 2025
1 parent 44c521a commit 8847853
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions functions/_tide_parent_dirs.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
function _tide_parent_dirs --on-variable PWD
set -g _tide_parent_dirs (string escape (
for dir in (string split / -- $PWD)
set -la parts $dir
string join / -- $parts
end))
set -g _tide_parent_dirs (
string escape (
for dir in (string split / -- $PWD)
if test (string length \"$dir\") -lt 1
continue
end
set -a parts $dir
string join "" (string join / -- $parts) ""
end))
end

0 comments on commit 8847853

Please # to comment.