promptuser() {
  # Prompt the user at the end of a build whether to extract contents of a newly-built installer into a subdirectory
  # called "test" inside the package source directory the build was manually initiated from. Has no effect on
  # autobuilds since they are simply installed right away.
  if [ "$SM_EXTRACTPROMPT" = "1" ] && [ -z "$SM_AUTOBUILD" ] && \
     [ -n "$SM_PACKLOCATION" ] ; then
    while true ; do
      echo
      echo "[NOTIFY] '"$APP"' has been built and SM_EXTRACTPROMPT is enabled in"
      echo "[NOTIFY] bldpkg.conf file. Would you like to extract and examine contents"
      echo "[NOTIFY] of its package installer in a 'test' directory within the"
      echo "[NOTIFY] current source directory"
      echo "[NOTIFY] ($SRCDIR) ?"

      read -r -p "[NOTIFY] Old test directory, if it exists already, will \
be overwritten. (y/N) " yn

      case $yn in
         [Yy]* ) echo "[INFO] Wise choice :-) ";
                 mkdir -p "$SRCDIR"/test
                 tar xvf "$SM_PACKLOCATION" -C "$SRCDIR"/test 
                 echo ""
                 echo "[INFO] '"$APP"' package installer file successfully\
 extracted"
                 break;;
              *) echo "[INFO] Nope? Alright." ; break ;;
      esac
    done
  fi


  # Prompt the user at the end of a successful build whether to install the newly created package. Has no effect on
  # autobuilds because packages there are installed automatically.
  if [ "$SM_INSTALLPROMPT" = "1" ] && [ -z "$SM_AUTOBUILD" ] && \
     [ -n "$SM_PACKLOCATION" ] ; then
    while true ; do 
      echo

      echo "[NOTIFY] '"$APP"' successfully built and SM_INSTALLPROMPT is \
enabled in the bldpkg.conf file."

      read -r -p "[NOTIFY] Would you like to install/upgrade it? (y/N) " yn
      case $yn in 
         [Yy]* ) echo "[INFO] Wise choice :-) "
                 upgradepkg --install-new "$SM_PACKLOCATION"
                 break;;
              *) echo "[INFO] Nope? Alright." ; exit 0 ;;
      esac
    done
  fi


  if [ -n "$SM_PKGSTATUS" ] && [ "$SM_PKGSTATUS" = "0" ]; then
    exit 0
  fi
}
