66 lines
1.0 KiB
Bash
66 lines
1.0 KiB
Bash
GREEN='\033[0;32m'
|
|
RED='\033[0;31m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
|
|
debug() {
|
|
if [[ -n "$DEBUG" ]]; then
|
|
local prompt=$1
|
|
shift
|
|
local messasge=$*
|
|
|
|
if [[ -n "$message" ]] ; then
|
|
message=": $message"
|
|
fi
|
|
|
|
echo -e "🐛 \033[0;36m[DEBUG] ${prompt}\033[0m${message}"
|
|
fi
|
|
}
|
|
|
|
error() {
|
|
local prompt=$1
|
|
shift
|
|
local messasge=$*
|
|
|
|
if [[ -n "$message" ]] ; then
|
|
message=": $message"
|
|
fi
|
|
|
|
echo -e "${RED}❌ ${prompt}:${NC}${message}"
|
|
exit 1
|
|
}
|
|
|
|
step() {
|
|
local prompt=$1
|
|
shift
|
|
local messasge=$*
|
|
|
|
if [[ -n "$message" ]] ; then
|
|
message=": $message"
|
|
fi
|
|
|
|
echo -e "${YELLOW}🔄 ${prompt}${NC}${message}"
|
|
}
|
|
|
|
success() {
|
|
local prompt=$1
|
|
shift
|
|
local messasge=$*
|
|
|
|
if [[ -n "$message" ]] ; then
|
|
message=": $message"
|
|
fi
|
|
|
|
echo -e "${GREEN}✅ ${prompt}${NC}${message}"
|
|
}
|
|
|
|
check_command() {
|
|
local command=$1
|
|
|
|
if [[ -z $(which ${command}) ]] ; then
|
|
error "Missing command" ${command}
|
|
fi
|
|
}
|
|
|