e063763c0e
- 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
15 lines
414 B
Fish
15 lines
414 B
Fish
# Copyright (C) 2026 Rootiest
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
function poke --description 'touch with automatic parent directory creation'
|
|
if test (count $argv) -eq 0
|
|
echo (set_color red)"poke: no file specified"(set_color normal) >&2
|
|
return 1
|
|
end
|
|
for _path in $argv
|
|
set -l _dir (dirname $_path)
|
|
_fish_mkdir_p --tree $_dir
|
|
touch $_path
|
|
end
|
|
end
|