fail="\033[31m" # red
warn="\033[33m" # yellow
good="\033[32m" # green
rset="\033[0m"  # reset

apt_update() {
  IFS='
'

  printf "${warn}%s${rset} " "Continue with updating? [y/n]"
  read -r update
  if [ "${update}" = 'y' ]; then
    separator "Updating apt(1) repository"
    apt update \
      && printf "${good}%s${rset}\n\n" "----> Updated apt(1) repository" \
      || return 1
  elif [ "${update}" = 'n' ]; then
    return 0
  else
    printf "${fail}%s${rset}\n" "Unknown option."
    apt_update
  fi
}
