#! /bin/sh
{ test -t 1 || test -t 0; } && FLAGS=-t
IMAGE=agoric/agoric-sdk:${TAG-latest}

case "$1" in
--pull)
  shift
  docker pull "$IMAGE"
  ;;
esac

exec docker run -i $FLAGS --net=host --entrypoint=ag-cosmos-helper \
  --volume=ag-cosmos-helper-state:/root/.ag-cosmos-helper \
  --rm "$IMAGE" ${1+"$@"}
