docs.brut.systems/start.sh
2026-01-28 15:44:46 -07:00

25 lines
481 B
Bash
Executable file

#!/usr/bin/env sh
EXECUTABLE="./docs.brut.systems"
git pull
if command -v go &> /dev/null; then
echo "Recompiling latest version..."
go build -o "$EXECUTABLE" .
if [ $? -ne 0 ]; then
echo "Compilation failed!"
exit 1
fi
echo "Compilation successful."
fi
if [ -x "$EXECUTABLE" ]; then
echo "Starting $EXECUTABLE..."
"$EXECUTABLE" "$@"
else
echo "Error: Executable not found and Go is not installed to compile it."
exit 1
fi