mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-13 14:16:46 +00:00
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>
49 lines
937 B
Bash
Executable File
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
|