Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions docs/static/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,37 +39,44 @@ RED='\033[38;5;196m'
BOLD='\033[1m'
RESET='\033[0m'

ECHO=`which echo || true`
if [ -z "$ECHO" ]; then
ECHO=echo
else
ECHO="$ECHO -e"
fi

info()
{
echo -e "${BOLD}${LIGHT_BLUE}" '[INFO] ' "$@" "${RESET}"
${ECHO} "${BOLD}${LIGHT_BLUE}" '[INFO] ' "$@" "${RESET}"
}

warn()
{
echo -e "${BOLD}${ORANGE}" '[WARN] ' "$@" "${RESET}" >&2
${ECHO} "${BOLD}${ORANGE}" '[WARN] ' "$@" "${RESET}" >&2
}

fatal()
{
echo -e "${BOLD}${RED}" '[ERROR] ' "$@" "${RESET}" >&2
${ECHO} "${BOLD}${RED}" '[ERROR] ' "$@" "${RESET}" >&2
exit 1
}

# --- custom choice functions ---
# like the logging functions, but with the -n flag to prevent the new line and keep the cursor in line for choices inputs like y/n
choice_info()
{
echo -e -n "${BOLD}${LIGHT_BLUE}" '[INFO] ' "$@" "${RESET}"
${ECHO} -n "${BOLD}${LIGHT_BLUE}" '[INFO] ' "$@" "${RESET}"
}

choice_warn()
{
echo -e -n "${BOLD}${ORANGE}" '[WARN] ' "$@" "${RESET}" >&2
${ECHO} -n "${BOLD}${ORANGE}" '[WARN] ' "$@" "${RESET}" >&2
}

choice_fatal()
{
echo -e -n "${BOLD}${RED}" '[ERROR] ' "$@" "${RESET}" >&2
${ECHO} -n "${BOLD}${RED}" '[ERROR] ' "$@" "${RESET}" >&2
exit 1
}

Expand Down
Loading