refactor(shell): extract _fish_mkdir_p utility; improve poke output

- Add _fish_mkdir_p: reusable mkdir -p with three output modes:
  --path (default): "Created: ~/full/path/" on one line
  --tree: dimmed existing anchor + cyan tree of newly-created dirs
  --silent: no output
  HOME is substituted with ~ in all output paths
- Refactor poke to delegate to _fish_mkdir_p --tree; removes inline
  mkdir/echo logic and gains ~ substitution and per-dir tree output
This commit is contained in:
2026-06-03 23:08:56 -04:00
parent c97c2290eb
commit e063763c0e
2 changed files with 63 additions and 4 deletions
+1 -4
View File
@@ -8,10 +8,7 @@ function poke --description 'touch with automatic parent directory creation'
end
for _path in $argv
set -l _dir (dirname $_path)
if not test -d $_dir
mkdir -p $_dir
and echo (set_color --bold cyan)"Created: "(set_color cyan)"$_dir"(set_color normal)
end
_fish_mkdir_p --tree $_dir
touch $_path
end
end