feat(shell): integrate _fish_mkdir_p into mkdir and mkcd
- mkdir: loop over path args calling _fish_mkdir_p --path; falls back to command mkdir -p when flag args (e.g. -m 755) are present - mkcd: default to _fish_mkdir_p --tree for new dirs; add -s/--silent flag to suppress tree output (mkcd's own status message still prints)
This commit is contained in:
@@ -44,12 +44,12 @@ function _fish_mkdir_p --description 'mkdir -p with configurable verbose output'
|
||||
|
||||
if test $mode = path
|
||||
set -l display (string replace -- "$HOME" "~" $target)"/"
|
||||
echo (set_color --bold cyan)"Created: "(set_color cyan)"$display"(set_color normal)
|
||||
echo (set_color --bold cyan)"Created directory: "(set_color cyan)"$display"(set_color normal)
|
||||
return 0
|
||||
end
|
||||
|
||||
# Tree mode: dimmed existing anchor, then cyan new dirs.
|
||||
echo (set_color --bold cyan)"Created missing directories:"(set_color normal)
|
||||
echo (set_color --bold yellow)"Created directories:"(set_color normal)
|
||||
set -l anchor (string replace -- "$HOME" "~" $cursor)"/"
|
||||
echo (set_color brblack)" $anchor"(set_color normal)
|
||||
set -l i 1
|
||||
|
||||
Reference in New Issue
Block a user