Browse Source

implement printNotice(), quit() and fix die()

master
belliash 11 years ago
parent
commit
8ac9902ef0
  1. 3
      ezbuild
  2. 3
      ezsync
  3. 15
      libraries/common

3
ezbuild

@ -15,6 +15,9 @@ source ${EZROOT}/libraries/common
loadLibraries
loadConfiguration
# Print EzBuild notice
printNotice
# Check system requirements
printInfo "Checking system prerequisites..."
checkPrerequisites

3
ezsync

@ -15,6 +15,9 @@ source ${EZROOT}/libraries/common
loadLibraries
loadConfiguration
# Print EzBuild notice
printNotice
# Check system requirements
printInfo "Checking system prerequisites..."
checkPrerequisites

15
libraries/common

@ -58,6 +58,7 @@ function die() {
echo -e "${MESG}\n${LOGS}" | mailx -s "${TOPIC}" "${NOTIFY}"
fi
printError "${1}"
echo -ne "\n"
exit ${2}
}
@ -190,6 +191,15 @@ function printInfo() {
echo -e " ${MESSAGE_INFO} ${@}"
}
#-------------------------------------------------------------------------------
# Outputs formatted information about EzBuild version and copyrights
#-------------------------------------------------------------------------------
function printNotice() {
echo -e "\n${COLOR_BOLD}EzBuild v${EZVERSION} (${EZNAME} launched)"
echo -e "${EZCOPYRIGHT}${COLOR_NORMAL}"
echo -e "${BORDER_STAR}\n"
}
#-------------------------------------------------------------------------------
# Outputs formatted warning to both display and log file
# Parameters: %message%
@ -199,6 +209,11 @@ function printWarn() {
echo -e " ${MESSAGE_WARN} ${@}"
}
function quit() {
echo -e "${COLOR_BOLD}ALL DONE!\n${COLOR_NORMAL}"
exit 0
}
#-------------------------------------------------------------------------------
# Restores original Internal Field Separator (IFS)
#-------------------------------------------------------------------------------

Loading…
Cancel
Save