#!/bin/bash echo "[0/7] Building..." if ! [ -d "doorgo" ]; then echo "[1/7] Cloning doorgo library" git clone https://git.red-green.com/RedGreen/doorgo --depth 1 else echo "[1/7] Updating doorgo library" cd doorgo git pull --no-rebase cd .. fi if ! [ -d ".bin" ]; then echo "[2/7] Making binary directory" mkdir .bin else echo "[2/7] Cleaning binary directory" rm -rf .bin mkdir .bin fi if ! [ -d "Server" ]; then echo "[3/7] Missing server codebase" echo "Please try 'git pull' or report this https://git.red-green.com/david/Core/issues/new" exit -1 else echo "[3/7] Found server codebase" fi if ! [ -d "Client" ]; then echo "[4/7] Missing client codebase" echo "Please try 'git pull' or report this https://git.red-green.com/david/Core/issues/new" exit -1 else echo "[4/7] Found client codebase" fi echo "[5/7] Building server..." cd Server go build if ! [ -f "core-server" ]; then echo "[5/7] Failed" echo "Please report this https://git.red-green.com/david/Core/issues/new" exit -1 else echo "[5/7] Ok" mv core-server ../.bin/core-server cd .. fi echo "[6/7] Building client..." cd Client go build if ! [ -f "core-client" ]; then echo "[6/7] Failed" echo "Please report this https://git.red-green.com/david/Core/issues/new" exit -1 else echo "[6/7] Ok" mv core-client ../.bin/core-client cd .. fi echo "[7/7] Done"