#!/usr/bin/env bash
set -euo pipefail

root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"

if [ -f "$root/services/core/go.mod" ]; then
  (cd "$root/services/core" && go build ./...)
fi

if [ -f "$root/apps/web/package.json" ]; then
  (cd "$root/apps/web" && npm run build)
fi

if [ -f "$root/apps/mobile/pubspec.yaml" ]; then
  (cd "$root/apps/mobile" && flutter build web)
fi
