diff --git a/scripts/functions b/scripts/functions index 95b74156..cc218991 100644 --- a/scripts/functions +++ b/scripts/functions @@ -323,6 +323,22 @@ CT_Popd() { popd >/dev/null 2>&1 } +# Create a dir and cd or pushd into it +# Usage: CT_mkdir_cd +# CT_mkdir_pushd +CT_mkdir_cd() { + local dir="${1}" + + mkdir -p "${dir}" + cd "${dir}" +} +CT_mkdir_pushd() { + local dir="${1}" + + mkdir -p "${dir}" + CT_Pushd "${dir}" +} + # Creates a temporary directory # $1: variable to assign to # Usage: CT_MktempDir foo