run.sh 411 B

123456789
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
  4. echo "usage: $0 <host-workspace> <command> [args...]"; exit 0
  5. fi
  6. if [[ $# -lt 2 ]]; then echo "workspace and command are required" >&2; exit 2; fi
  7. workspace="$1"; shift
  8. root="$(cd "$(dirname "$0")/../.." && pwd)"
  9. exec python3 "$root/tools/dev_container.py" --workspace "$workspace" run --workdir /workspace -- "$@"