feat(input): add codex automation stack
This commit is contained in:
		
							
								
								
									
										35
									
								
								input/Docker/run-input-processor.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										35
									
								
								input/Docker/run-input-processor.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| #!/usr/bin/env bash | ||||
| # Wrapper to run docker compose with the caller's UID/GID so generated files stay writable. | ||||
| set -euo pipefail | ||||
|  | ||||
| if ! command -v docker >/dev/null 2>&1; then | ||||
|   echo "Error: docker is not installed or not on PATH." >&2 | ||||
|   exit 1 | ||||
| fi | ||||
|  | ||||
| if docker compose version >/dev/null 2>&1; then | ||||
|   COMPOSE_CMD=(docker compose) | ||||
| elif command -v docker-compose >/dev/null 2>&1; then | ||||
|   COMPOSE_CMD=(docker-compose) | ||||
| else | ||||
|   echo "Error: docker compose plugin or docker-compose binary is required." >&2 | ||||
|   exit 1 | ||||
| fi | ||||
|  | ||||
| CALLER_UID=$(id -u) | ||||
| CALLER_GID=$(id -g) | ||||
|  | ||||
| DEFAULT_CODEX_CONFIG="${HOME}/.codex" | ||||
| CODEX_CONFIG_DIR=${CODEX_CONFIG_DIR:-${DEFAULT_CODEX_CONFIG}} | ||||
|  | ||||
| mkdir -p "${CODEX_CONFIG_DIR}" | ||||
|  | ||||
| SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||||
|  | ||||
| ( | ||||
|   cd "${SCRIPT_DIR}" | ||||
|   LOCAL_UID="${CALLER_UID}" \ | ||||
|   LOCAL_GID="${CALLER_GID}" \ | ||||
|   CODEX_CONFIG_DIR="${CODEX_CONFIG_DIR}" \ | ||||
|     "${COMPOSE_CMD[@]}" "$@" | ||||
| ) | ||||
		Reference in New Issue
	
	Block a user