feat(setup): sync role scripts from missions repo to core app

This commit is contained in:
2025-12-28 15:50:04 +01:00
parent e0e922e9dc
commit bd957b48d0

View File

@@ -64,6 +64,33 @@ else
sudo -u "$USER_NAME" git pull || true
fi
# 3b. Sync Roles to Core
# We assume the repo has a 'crumbforest_roles' directory compatible with our app
# The roles are needed in /opt/crumbforest/app/crumbforest_roles for the wrapper to find them
REPO_ROLES_DIR="$HOME_DIR/missions/crumbforest_roles"
APP_ROLES_DIR="/opt/crumbforest/app/crumbforest_roles"
if [ -d "$REPO_ROLES_DIR" ]; then
print_info "Syncing roles from $REPO_ROLES_DIR to $APP_ROLES_DIR..."
# Ensure target exists
mkdir -p "$APP_ROLES_DIR"
# Copy scripts, overwrite existing (force update)
# We use cp -f to overwrite.
cp -f "$REPO_ROLES_DIR"/*_zero.sh "$APP_ROLES_DIR/" 2>/dev/null || print_info "No zero scripts found to sync."
# Ensure they are executable and owned correctly
chmod +x "$APP_ROLES_DIR"/*.sh
chown root:crumbforest "$APP_ROLES_DIR"/*.sh
# Ensure group can read/exec (wrapper runs as user in group crumbforest, eventually via sudo or direct exec)
chmod 750 "$APP_ROLES_DIR"/*.sh
print_info "Roles synced and permissions set."
else
print_info "No 'crumbforest_roles' directory found in mission repo. Skipping role sync."
fi
# 4. Setup .bashrc for the Codex
# We append a customized welcome message if not present
if ! grep -q "CrumbCodex" "$HOME_DIR/.bashrc"; then