#!/usr/bin/env bash # Bootstrap OPENKKND2_ROOT and seed legal stubs. set -euo pipefail openkknd2_bootstrap() { local root="${1:?root}" mkdir -p "$root"/{src,include,assets/cinematics,docs,scripts,tests} if [[ ! -f "$root/LICENSE" ]]; then cat >"$root/LICENSE" <<'L' MIT License Copyright (c) 2026 openkknd2 contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. L fi if [[ ! -f "$root/THIRD_PARTY.md" ]]; then cat >"$root/THIRD_PARTY.md" <<'T' # Third-party Only permissive / original materials. **Forbidden:** KKnD/KKnD2/Xtreme proprietary assets. | Component | License | Note | |-----------|---------|------| | (none yet) | | | T fi if [[ ! -f "$root/docs/LORE.md" ]]; then cat >"$root/docs/LORE.md" <<'O' # Lore (original) Working names (change freely; **do not** use commercial KKnD faction trademarks as official names): - Faction A: **Ashcoat Compact** (scrap tech, discipline) - Faction B: **Bloomed** (mutated ecology, swarm tactics) Tone: dry wasteland humor, not a copy of any commercial script. O fi if [[ ! -f "$root/AGENT_LOG.md" ]]; then echo "# Agent log" >"$root/AGENT_LOG.md" echo "" >>"$root/AGENT_LOG.md" echo "Started $(date -u +%Y-%m-%dT%H:%M:%SZ)" >>"$root/AGENT_LOG.md" fi if [[ ! -f "$root/scripts/ci-headless.sh" ]]; then cat >"$root/scripts/ci-headless.sh" <<'C' #!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" # Placeholder until engine exists: legal tree check rg -i 'kknd2|krossfire|\.iso\b' --glob '!**/.git/**' . && { echo "FORBIDDEN string found" >&2 exit 2 } || true echo "ci-headless: stub OK (extend when binary exists)" C chmod +x "$root/scripts/ci-headless.sh" fi if [[ ! -f "$root/README.md" ]]; then cat >"$root/README.md" <