#!/usr/bin/env bash

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd "$SCRIPT_DIR"

set -e

if ! pip3 list | grep "cbor2" > /dev/null 2>&1; then
  pip3 install -r requirements.txt
fi

mkdir -p cache

outdir=${ASSET_OUTPUT_DIR:-output}

./setup

echo "building desktop"
python3 base.py \
  --root https://static.sourga.me/blobs/6481/.index.source \
  --models \
  --textures \
  --outdir $outdir/desktop \
  complex dust2 turbine

echo "building mobile"
python3 base.py \
  --root https://static.sourga.me/blobs/6481/.index.source \
  --mobile \
  --outdir $outdir/mobile \
  none
