diff --git a/.zprezto/abra/functions.zsh b/.zprezto/abra/functions.zsh index 5a0d700..2b729f2 100644 --- a/.zprezto/abra/functions.zsh +++ b/.zprezto/abra/functions.zsh @@ -76,6 +76,25 @@ function sublr { echo "subl /Users/abra/mount/$HOSTNAME/$FULL_PATH" > /projects/subl_remote/fifo } +function cdtmp { + FUNCTION_PRELUDE + + local DATESTR="$(date +%Y-%m-%d_%H:%M:%S)" + local DIR_PATH="${HOME}/tmp/auto_${DATESTR}" + + if [[ -n "$1" ]]; then + local DIR_PATH="${DIR_PATH}_$1" + fi + + if [[ -e "${DIR_PATH}" ]]; then + echo "${DIR_PATH} already exists" + return 1 + fi + + mkcd "${DIR_PATH}" + echo "${DIR_PATH}" +} + function mkcd { FUNCTION_PRELUDE_NO_XTRACE