My dotfiles utilizing Chezmoi for management https://www.chezmoi.io/
 
 

10 lines
188 B

# Make a temporary directory and enter it
mktmpdir() {
local dir
if [ $# -eq 0 ]; then
dir=$(mktemp -d)
else
dir=$(mktemp -d -t "${1}.XXXXXXXXXX")
fi
cd "$dir" || exit
}