#!/bin/bash

echo "Before you do this, make sure to load in a virtual environment (i.e. python -m venv .venv; source .venv/bin/activate)"

# Define the repository URLs
REPO1="https://github.com/mbari-org/lcmto.git"
REPO2="git@bitbucket.org:mbari/oi-lcm-types.git"


# Define the directory to clone the repositories into
TARGET_DIR="./build"

# Create the target directory if it doesn't exist
mkdir -p "$TARGET_DIR"

# Change to the target directory
cd "$TARGET_DIR"

# Clone the repositories
git clone "$REPO1"
git clone "$REPO2"

echo "Repositories cloned successfully."

# Install LCMTO (and LCM Binaries as well as dependencies)
cd lcmto
python -m pip install .
cd ..

# Generate LCM Types for OI
cd oi-lcm-types
lcm-gen -p *.lcm --ppath ../../

