Files
fish-config/functions/mkdir.fish
T
rootiest c2afa1201f 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)
2026-06-03 23:22:30 -04:00

21 lines
538 B
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# Execute mkdir
function mkdir --description 'Execute mkdir'
if status is-interactive
# Fall back to command mkdir -p when flags are present (e.g. -m 755)
for _arg in $argv
if string match -q -- '-*' $_arg
command mkdir -p $argv
return $status
end
end
for _dir in $argv
_fish_mkdir_p --path $_dir
end
else
command mkdir $argv
end
end