#!/bin/sh
# Draupnir sliceability check — OrcaSlicer 2.4.2, containerised.
#
# Containerised because irv-ml1 (Debian 12, glibc 2.36) CANNOT run the only
# AppImage OrcaSlicer ships (Ubuntu 24.04, needs GLIBC_2.38 / GLIBCXX_3.4.32).
# Verified by ldd, not assumed. See services/draupnir-slicer/Dockerfile.
#
# ⚠ ORCASLICER WRITES result.json INTO THE WORKING DIRECTORY on EVERY
# invocation — including --help, which is as read-only as a call gets. Verified
# here, not inferred: an empty dir gained result.json from --help alone. Call
# this from inside the run's own artifact dir or it litters wherever you were.
# Found by brokkr-smithy-dev on --info; I had verified only --help and called
# it done. Usage text proves the binary starts, not that it behaves.
#
# $PWD is mounted at the same path inside the container, so relative paths and
# the result.json land where you expect. /mnt/smithy/draupnir is mounted too so
# artifact paths work unchanged.
exec docker run --rm \
  -v /mnt/smithy/draupnir:/mnt/smithy/draupnir \
  -v "$PWD:$PWD" -w "$PWD" \
  draupnir/orca-slicer:2.4.2 "$@"
