Files
crumbmissions/crumbmission/dynamic_mission_selector.sh
Branko May Trinkwald 2915828adf Add complete Crumbforest mission system
- Interactive mission selector with metadata-driven design
- 5 educational missions (basics + advanced)
- AI assistant roles (Deepbit, Bugsy, Schnippsi, Tobi)
- SnakeCam gesture recognition system
- Token tracking utilities
- CLAUDE.md documentation
- .gitignore for logs and secrets
2025-12-21 01:16:48 +01:00

57 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
clear
echo "🌟 Willkommen im Crumbforest Missionszentrum!"
sleep 1
MISSION_DIR="/usr/local/bin/crumbmission/basics/"
cd "$MISSION_DIR" || exit
# Alle Mission-Skripte erkennen
mapfile -t SCRIPTS < <(find "$MISSION_DIR" -maxdepth 1 -type f -executable -name "*.sh" | sort)
# Metadaten laden
declare -a DISPLAY_OPTIONS
declare -A SCRIPT_MAP
for script in "${SCRIPTS[@]}"; do
name="$(basename "$script" .sh)"
meta="$MISSION_DIR/$name.meta.json"
if [[ -f "$meta" ]]; then
icon=$(jq -r '.icon' "$meta")
title=$(jq -r '.title' "$meta")
DISPLAY_OPTIONS+=("$icon $title")
else
DISPLAY_OPTIONS+=("🛸 $name")
fi
SCRIPT_MAP["$name"]="$script"
done
# ❌ Beenden hinzufügen
DISPLAY_OPTIONS+=("❌ Beenden")
while true; do
echo ""
echo "🌲 Wähle deine Mission:"
for i in "${!DISPLAY_OPTIONS[@]}"; do
printf " %d) %s\n" "$((i + 1))" "${DISPLAY_OPTIONS[$i]}"
done
echo ""
read -p "🔢 Gib die Zahl deiner Wahl ein: " choice
if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#DISPLAY_OPTIONS[@]} )); then
if (( choice == ${#DISPLAY_OPTIONS[@]} )); then
echo "👋 Auf bald, kleiner Krümel!"
exit 0
else
script_path="${SCRIPTS[$((choice - 1))]}"
echo "▶️ Starte: $script_path"
bash "$script_path"
fi
else
echo "❗ Ungültige Eingabe bitte eine Zahl von 1 bis ${#DISPLAY_OPTIONS[@]} eingeben."
fi
done