Files
neoromantique-dotfiles/home/private_dot_config/fish/functions/tmpdir.fish
David Aizenberg 11e5fb4e54 sync
2025-12-14 03:24:35 +01:00

12 lines
307 B
Fish

function tmpdir --description "Create and cd into a temp directory under ~/tmp"
set -l date (date +%Y%m%d)
if test -n "$argv[1]"
set -l dir ~/tmp/$date-$argv[1]
mkdir -p $dir && cd $dir
else
set -l dir ~/tmp/{$date}_(random)
mkdir -p $dir && cd $dir
end
end