if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
error() {
printf "${BOLD}${RED}$1${NORMAL}"
}
abort() {
error "\nAborting...\n"
exit 1
}
set -e
cwd=$PWD
printf "${BOLD}Attempting to connect to device via adb...\nMake sure 'file transfer' mode is set on device. You may have to accept the connection and then re-run this script.\n${NORMAL}"