#!/bin/bash
# The image ships only the locked environment; pimm itself imports from the
# checkout that the entrypoint put on PYTHONPATH.
if ! python -c 'import importlib.util, sys; sys.exit(0 if importlib.util.find_spec("pimm") else 1)'; then
  echo 'error: no pimm checkout found; run from inside a pimm clone' >&2
  echo '(for example: docker run --rm --gpus all -v "$PWD:$PWD" -w "$PWD" <image> pimm ...)' >&2
  exit 1
fi
exec python -m pimm.cli "$@"
