mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
Package renames (dynamic discovery picks up new names automatically):
- cli/build/role_include/ -> cli/build/include/
- cli/build/roles_list/ -> cli/build/list/
- cli/meta/roles/lifecycle_filter/ -> cli/meta/roles/lifecycle/
Domain logic moved out of cli/ (no CLI surface, just a helper class):
- cli/meta/roles/applications/resolution/services/{resolver,errors}.py
-> utils/roles/applications/services/{resolver,errors}.py
- drop dead services/yaml_utils.py + its only test
Bug fixes:
- cli/meta/{callorder -> roles/callorder} dropped its hard-coded
parents[3] PROJECT_ROOT (broke after the directory move and resolved
to <repo>/cli/); it now reuses utils.PROJECT_ROOT.
Help renderer (cli/core/help.py + colors.py):
- DIM color on the description column to separate it from the command name
- Blank line between the long command name and its wrapped description
- Italic invocation under the category heading + leading blank line
- New Style.ITALIC
Doc updates: path references in docs/requirements/00{8,10}*.md plus
soft-wrap fixes in the touched regions.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
82 lines
2.2 KiB
Bash
Executable File
82 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
echo "🔧 Running project setup (no installation)"
|
|
|
|
# ------------------------------------------------------------
|
|
# Hard-coded configuration (NOT overridable)
|
|
# ------------------------------------------------------------
|
|
# Prefer Makefile-provided venv interpreter (exported as PYTHON).
|
|
# Fallback to python3 if not set.
|
|
: "${PYTHON:?PYTHON must be set by Makefile (venv python3)}"
|
|
|
|
# Optional: show interpreter for debugging
|
|
echo "🐍 Using PYTHON=${PYTHON}"
|
|
if command -v "${PYTHON}" >/dev/null 2>&1; then
|
|
"${PYTHON}" -c 'import sys; print("sys.executable=", sys.executable)' || true
|
|
fi
|
|
|
|
ROLES_DIR="./roles"
|
|
|
|
INCLUDES_SCRIPT="./cli/build/include/__main__.py"
|
|
INCLUDES_OUT_DIR="./tasks/groups"
|
|
|
|
# ------------------------------------------------------------
|
|
# Validation
|
|
# ------------------------------------------------------------
|
|
require_file() {
|
|
local path="$1"
|
|
[[ -f "$path" ]] || {
|
|
echo "❌ File not found: $path" >&2
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
require_dir() {
|
|
local path="$1"
|
|
[[ -d "$path" ]] || {
|
|
echo "❌ Directory not found: $path" >&2
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
require_cmd() {
|
|
command -v "$1" >/dev/null || {
|
|
echo "❌ Command not found: $1" >&2
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
require_cmd "${PYTHON}"
|
|
require_dir "${ROLES_DIR}"
|
|
require_file "${INCLUDES_SCRIPT}"
|
|
|
|
# ------------------------------------------------------------
|
|
# Helpers
|
|
# ------------------------------------------------------------
|
|
log_section() {
|
|
echo
|
|
echo "------------------------------------------------------------"
|
|
echo "$1"
|
|
echo "------------------------------------------------------------"
|
|
}
|
|
|
|
# ------------------------------------------------------------
|
|
# Role include files
|
|
# ------------------------------------------------------------
|
|
log_section "🧩 Generating role include files"
|
|
mkdir -p "${INCLUDES_OUT_DIR}"
|
|
|
|
mapfile -t INCLUDE_GROUPS < <("${PYTHON}" -m cli.meta.categories.invokable -s "-")
|
|
|
|
for grp in "${INCLUDE_GROUPS[@]}"; do
|
|
[[ -z "${grp}" ]] && continue
|
|
out="${INCLUDES_OUT_DIR}/${grp}roles.yml"
|
|
echo "→ Building ${out} (pattern: '${grp}')"
|
|
"${PYTHON}" "${INCLUDES_SCRIPT}" "${ROLES_DIR}" -p "${grp}" -o "${out}"
|
|
echo " ✅ ${out}"
|
|
done
|
|
|
|
echo
|
|
echo "🎉 Project setup completed"
|