#!/usr/bin/env bash set -euo pipefail if [[ "$#" -ne 1 ]]; then echo "usage: $0 /absolute/path/to/dualprop-sdil" >&2 exit 2 fi target="$1" if [[ "$target" != /* ]]; then echo "target must be an absolute path" >&2 exit 2 fi if [[ -e "$target" ]]; then echo "refusing to overwrite existing target: $target" >&2 exit 2 fi main_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" patch_root="$main_root/external/dualprop_patches" base_revision="7b2595b34421e1483a721dbfdeff8cdabda3a1ff" if [[ "$(find "$patch_root" -maxdepth 1 -name '*.patch' | wc -l)" -ne 19 ]]; then echo "expected 19 frozen Dual Propagation patches" >&2 exit 1 fi git clone https://github.com/Rasmuskh/dualprop_icml_2024.git "$target" git -C "$target" checkout -b sdil-a6000 "$base_revision" git -C "$target" config user.name "SDIL replication runner" git -C "$target" config user.email "sdil-replication@invalid.example" git -C "$target" am --committer-date-is-author-date "$patch_root"/*.patch echo "plain-CNN runner ready at $target" git -C "$target" log -1 --oneline