#!/bin/bash
# dk COMMAND: run COMMAND in /www/tiger-ripgrep's build image (rg-tiger) on precision, in /fd. Run it there, from
# ~/Claude/tiger-fd/repo. ~/Claude/tiger-fd is /fd (read-write: repo, src, build, logs). ripgrep's tree ~/rg-tiger
# (mrustc, the standard library of each half, the target files, the C compiler wrapper and its compat shim) is /rg,
# and its copy of the darwin8 toolchain, ~/rg-tiger/w, is /w: both read-only, so fd's build cannot change them.
exec docker run --rm -i -u "$(id -u):$(id -g)" -e HOME=/fd -e PARLEVEL \
  -v "$HOME/Claude/tiger-fd:/fd" -v "$HOME/rg-tiger:/rg:ro" -v "$HOME/rg-tiger/w:/w:ro" -w /fd rg-tiger bash -c "$*"
