#!/usr/bin/env bash

# TODO: dynamically install pijul at ${PIJUL_VERSION} if it's not already
# installed

# TODO: default to using a locally built copy of pijul with a set of patches
# applied on top to enable experimentation

REPO_DIR="/tmp/repo"

git clone "${GIT_REPO}" "${REPO_DIR}"

pushd /tmp
pijul clone https://nest.pijul.com/mx00s/pijul
pushd ./pijul
cargo build --features git
cargo run --features git -- git "${REPO_DIR}" 2>&1 | ts -s
popd
popd