Add build and install scripts

This commit is contained in:
João Carlos Machado de Paiva Araújo 2026-10-03 13:24:28 +00:00
parent 9fb0313b53
commit aa0229b190
2 changed files with 32 additions and 0 deletions

11
scripts/build Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
IMAGE_NAME="opencode"
echo "Building image '${IMAGE_NAME}' using Podman..."
podman build -t "${IMAGE_NAME}" -f "${REPO_ROOT}/Containerfile" "${REPO_ROOT}"
echo "✅ Build completed: ${IMAGE_NAME}"

21
scripts/install Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CODE_SCRIPT="${SCRIPT_DIR}/code"
INSTALL_DIR="${HOME}/bin"
INSTALL_PATH="${INSTALL_DIR}/code"
if [[ ! -f "${CODE_SCRIPT}" ]]; then
echo "Error: ${CODE_SCRIPT} not found." >&2
exit 1
fi
mkdir -p "${INSTALL_DIR}"
cp "${CODE_SCRIPT}" "${INSTALL_PATH}"
chmod +x "${INSTALL_PATH}"
echo "Installed: ${INSTALL_PATH}"
echo "Ensure ${INSTALL_DIR} is in your PATH."