_zimfw_tool_mkdir() {
  # This runs in a subshell
  readonly -i SUBMODULES=${6}
  readonly ACTION=${1} DIR=${2} TYPE=${4} REV=${5} ONPULL=${7}
  if [[ ${ACTION} == (pre|prereinstall) ]] return 0
  if [[ ${ACTION} == check ]]; then
    _zimfw_print_okay 'Skipping mkdir module' 1
    return 0
  fi
  if [[ -n ${REV} ]]; then
    _zimfw_print_warn "The zmodule option ${_zbold}-${TYPE[1]}${_znormalyellow}|${_zbold}--${TYPE}${_znormalyellow} has no effect when using the mkdir tool"
  fi
  if (( ! SUBMODULES )); then
    _zimfw_print_warn "The zmodule option ${_zbold}--no-submodules${_znormalyellow} has no effect when using the mkdir tool"
  fi
  if [[ ! -d ${DIR} || -n ${ONPULL} ]]; then
    local -r zroot_dirs=(${(M)_zroot_dirs:#${DIR}(|/*)})
    local zroot_dir
    for zroot_dir in ${zroot_dirs}; do
      _zimfw_create_dir ${zroot_dir} || return 1
    done
    _zimfw_pull_print_okay Created || return 1
  fi
}
