Files
computer-playbook/scripts/docker/entry.sh
T
kevinveenbirkenbachandClaude Opus 4.7 ad270fbbeb feat(cli): add --version / -V flag to infinito CLI
The Docker entry script's `[docker-infinito] Installed:` banner used
to call `pkgmgr version infinito`; after the pkgmgr removal that line
became `infinito --version || true`, which printed
`Error: command '--version' not found.` to stderr because the CLI's
argparse-style dispatcher treated `--version` as an unknown
subcommand.

Hook a real top-level flag into cli.core.app.parse_flags that prints
`infinito <version>` from importlib.metadata (single source of truth:
pyproject.toml's `version` field; falls back to `unknown` when the
package isn't pip-installed) and exits 0. entry.sh drops the
`|| true` since the call is now well-defined.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 16:24:06 +02:00

49 lines
937 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
echo "[docker-infinito] Starting infinito container"
if [[ "${1:-}" == "/sbin/init" ]]; then
echo "[docker-infinito] Starting systemd as PID 1..."
exec /sbin/init
fi
: "${INFINITO_SRC_DIR:?INFINITO_SRC_DIR must be set by the container environment}"
export INFINITO_SRC_DIR
run_local_build() {
echo "[docker-infinito] Build enabled (--compile)"
cd "${INFINITO_SRC_DIR}"
echo "[docker-infinito] Reinstall via 'make install' in ${INFINITO_SRC_DIR}..."
make install
echo "[docker-infinito] Installed:"
infinito --version
}
while [[ $# -gt 0 ]]; do
case "$1" in
--compile)
shift
run_local_build
;;
--compile-silent)
shift
run_local_build >/dev/null 2>&1
;;
--)
shift
break
;;
*)
break
;;
esac
done
if [[ $# -eq 0 ]]; then
echo "[docker-infinito] No arguments provided. Showing infinito help..."
exec infinito --help
else
cd "${INFINITO_SRC_DIR}"
exec "$@"
fi