Skip to content
This repository was archived by the owner on Jul 2, 2023. It is now read-only.
This repository was archived by the owner on Jul 2, 2023. It is now read-only.

Remove colors in Nox output #131

Description

@kevingrillet

AFK-Daily/afk-daily.sh

Lines 279 to 305 in 27dde5c

# ##############################################################################
# Function Name : printInColor
# Descripton : Print message in color
# Args : <TYPE> <MESSAGE>
# ##############################################################################
printInColor() {
if [ "$#" -ne 2 ]; then
echo "Usage: printInColor <TYPE> <MESSAGE>" >&2
echo " <TYPE>: DEBUG, DONE, ERROR, INFO, TEST, WARN" >&2
return
fi
if [ "$1" = "DEBUG" ]; then
msg="${cPurple}[DEBUG]${cNc} "
elif [ "$1" = "DONE" ]; then
msg="${cGreen}[DONE]${cNc} "
elif [ "$1" = "ERROR" ]; then
msg="${cRed}[ERROR]${cNc} "
elif [ "$1" = "INFO" ]; then
msg="${cBlue}[INFO]${cNc} "
elif [ "$1" = "WARN" ]; then
msg="${cYellow}[WARN]${cNc} "
else
msg=" "
fi
shift
echo "$msg$1${cNc}" # The ${cNc} is a security if we forgot to reset color at the end of our message
}

With Nox colors are broken, so let's remove them!
Possible solution: https://stackoverflow.com/q/17998978

Add new option -c to remove colors

AFK-Daily/afk-daily.sh

Lines 53 to 54 in 27dde5c

while getopts "e:fi:l:s:tv:w" opt; do
case $opt in

Before this line, if [ "$device" == "Nox" ] add args="$args -c"

"$adb" shell sh "$2"/scripts/afk-arena/afk-daily.sh "$args" && saveDate

Metadata

Metadata

Assignees

Labels

File: afk-daily.sh 📁Everything afk-daily.sh related.File: deploy.sh 📁Everything deploy.sh related.Good first issue 👌If you're new here, check this out!Priority: Low ❄️Don't worry, at least for now. But don't forget about it!Status: Done ✔️I hope you actually did something well this time.Type: Enhancement ⏫Somebody says your code could be better! And they're probably right.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions