#!/bin/bash
# Unpacks the e2e binaries built earlier in this workflow into the checkout. The
# caller sets E2E_PREBUILT so the kind targets use them rather than rebuilding.

set -euo pipefail

cd "$(git rev-parse --show-toplevel)"
( cd /tmp && artifact pull workflow e2e-binaries.tar )
# -m: the checkout is newer than the binaries' build, and make would rebuild
# whatever looks older than its sources.
tar -m -xf /tmp/e2e-binaries.tar
rm -f /tmp/e2e-binaries.tar
