docs.brut.systems/start.sh
2026-01-28 15:49:39 -07:00

26 lines
511 B
Bash
Executable file

#!/usr/bin/env sh
EXECUTABLE="./docs.brut.systems"
echo "Fetching latest version"
git pull origin master
if command -v go &> /dev/null; then
echo "Recompiling..."
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