Skip to content

Commit

Permalink
Print error messages to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
natanjunges authored and flexiondotorg committed Oct 5, 2022
1 parent 548bad1 commit 674133a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions deb-get
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ function fancy_message() {
progress) echo -en " [${GREEN}+${RESET}] ${MESSAGE}";;
recommend) echo -e " [${MAGENTA}!${RESET}] ${MESSAGE}";;
warn) echo -e " [${YELLOW}*${RESET}] WARNING! ${MESSAGE}";;
error) echo -e " [${RED}!${RESET}] ERROR! ${MESSAGE}";;
fatal) echo -e " [${RED}!${RESET}] ERROR! ${MESSAGE}"
error) echo -e " [${RED}!${RESET}] ERROR! ${MESSAGE}" >&2;;
fatal) echo -e " [${RED}!${RESET}] ERROR! ${MESSAGE}" >&2
exit 1;;
*) echo -e " [?] UNKNOWN: ${MESSAGE}";;
esac
Expand Down Expand Up @@ -303,7 +303,7 @@ function validate_deb() {

if [[ ! " ${APPS[*]} " =~ " ${APP} " ]]; then
fancy_message error "${APP} is not a supported application."
list_debs
list_debs >&2
exit 1
fi

Expand Down Expand Up @@ -331,9 +331,9 @@ function validate_deb() {
deb_${APP} 2>/dev/null
if [ -z "${PRETTY_NAME}" ] || [ -z "${SUMMARY}" ] || [ -z "${WEBSITE}" ]; then
fancy_message eror "Missing required information of package ${APP}:"
echo "PRETTY_NAME=${PRETTY_NAME}"
echo "SUMMARY=${SUMMARY}"
echo "WEBSITE=${WEBSITE}"
echo "PRETTY_NAME=${PRETTY_NAME}" >&2
echo "SUMMARY=${SUMMARY}" >&2
echo "WEBSITE=${WEBSITE}" >&2
exit 1
fi
VERSION_INSTALLED=$(version_deb)
Expand All @@ -342,15 +342,15 @@ function validate_deb() {
if [ "${ACTION}" != "prettylist" ]; then
if [ -z "${APT_LIST_NAME}" ] || ([ -z "${ASC_KEY_URL}" ] && [ -z "${GPG_KEY_URL}" ]); then
fancy_message error "Missing required information of apt package ${APP}:"
echo "APT_LIST_NAME=${APT_LIST_NAME}"
echo "ASC_KEY_URL=${ASC_KEY_URL}"
echo "GPG_KEY_URL=${GPG_KEY_URL}"
echo "APT_LIST_NAME=${APT_LIST_NAME}" >&2
echo "ASC_KEY_URL=${ASC_KEY_URL}" >&2
echo "GPG_KEY_URL=${GPG_KEY_URL}" >&2
exit 1
fi
if [ -n "${ASC_KEY_URL}" ] && [ -n "${GPG_KEY_URL}" ]; then
fancy_message error "Conflicting repository key types for apt package ${APP}:"
echo "ASC_KEY_URL=${ASC_KEY_URL}"
echo "GPG_KEY_URL=${GPG_KEY_URL}"
echo "ASC_KEY_URL=${ASC_KEY_URL}" >&2
echo "GPG_KEY_URL=${GPG_KEY_URL}" >&2
exit 1
fi
fi
Expand All @@ -359,8 +359,8 @@ function validate_deb() {
else
if (([ "${METHOD}" = github ] && [ -e "${CACHE_DIR}/${APP}.json" ]) || ([ "${METHOD}" != github ] && [ "${ACTION}" != "prettylist" ])) && ([ -z "${URL}" ] || [ -z "${VERSION_PUBLISHED}" ]); then
fancy_message error "Missing required information of ${METHOD} package ${APP}:"
echo "URL=${URL}"
echo "VERSION_PUBLISHED=${VERSION_PUBLISHED}"
echo "URL=${URL}" >&2
echo "VERSION_PUBLISHED=${VERSION_PUBLISHED}" >&2
exit 1
fi
fi
Expand Down Expand Up @@ -2910,15 +2910,15 @@ if [ -n "${1}" ]; then
shift
else
fancy_message error "You must specify an action."
usage
usage >&2
exit 1
fi

case ${ACTION} in
install|reinstall|remove|purge|show)
if [ -z "${1}" ]; then
fancy_message error "You must specify an app:\n"
list_debs
list_debs >&2
exit 1
fi
print_etc_overrides;;
Expand Down

0 comments on commit 674133a

Please # to comment.