Skip to content

Commit

Permalink
build 🔧 Improve logging with colors!
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Jun 13, 2024
1 parent fa3eec6 commit 4e99acb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:18.04

ARG GAME

RUN if [ -z "$GAME" ]; then echo "Error: The GAME environment variable is not set, specify one and try again. Please refer to the README for instructions: https://github.com/JamesIves/hlds-docker" && exit 1; fi
RUN if [ -z "$GAME" ]; then printf "\033[31mError: The GAME environment variable is not set, specify one and try again. Please refer to the README for instructions: https://github.com/JamesIves/hlds-docker\033[0m\n" && exit 1; fi

RUN dpkg --add-architecture i386 && \
apt-get update && \
Expand Down
8 changes: 4 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env sh

if [ -z "$GAME" ]; then
echo "Error: The GAME environment variable is not set, please refer to the README for instructions: https://github.com/JamesIves/hlds-docker"
echo -e "\e[31mError: The GAME environment variable is not set, please refer to the README for instructions: https://github.com/JamesIves/hlds-docker\e[0m"
exit 1
fi

if [[ "$@" != *"+map"* ]]; then
echo "Warning: No +map specified in the command. Server will start but may not be joinable."
if echo "$@" | grep -qv "+map"; then
echo -e "\e[33mWarning: No +map specified in the command. Server will start but may not be joinable.\e[0m"
fi

if [ -d /temp/hlds ]
then
rsync --chown=steam:steam /temp/hlds/* /opt/steam/hlds/$GAME
fi

echo Starting Half-Life Dedicated Server...
echo -e "\e[32mStarting Half-Life Dedicated Server...\e[0m"

./hlds_run "-game $GAME $@"

0 comments on commit 4e99acb

Please sign in to comment.