#!/bin/bash
set -e

OUT_DIR="./bin"
mkdir -p "$OUT_DIR"

echo "Baue ingest ..."
GOOS=linux  GOARCH=amd64 go build -o "$OUT_DIR/ingest"     ./cmd/ingest/
GOOS=windows GOARCH=amd64 go build -o "$OUT_DIR/ingest.exe" ./cmd/ingest/
echo "  Linux:   $OUT_DIR/ingest"
echo "  Windows: $OUT_DIR/ingest.exe"

echo "Baue ask ..."
GOOS=linux  GOARCH=amd64 go build -o "$OUT_DIR/ask"     ./cmd/ask/
GOOS=windows GOARCH=amd64 go build -o "$OUT_DIR/ask.exe" ./cmd/ask/
echo "  Linux:   $OUT_DIR/ask"
echo "  Windows: $OUT_DIR/ask.exe"

echo ""
echo "Fertig. Nutzung:"
echo "  $OUT_DIR/ingest                    # Markdown importieren"
echo "  $OUT_DIR/ingest bild.json          # JSON importieren"
echo "  $OUT_DIR/ask \"Was sind meine Pläne?\""
