From c4775ca99e71486737af55ac27c351ab4d531c50 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 4 Jun 2026 06:25:30 +0200 Subject: [PATCH] Fix update flow: git pull statt checkout, Plugin-Dateien direkt kopieren, kein ./install.sh Selbstaufruf --- install.sh | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index c60db75..218e545 100644 --- a/install.sh +++ b/install.sh @@ -206,7 +206,7 @@ perform_update() { stashed=true fi - # Get remote version + # Get remote version (for display only) local remote_version remote_version=$(git ls-remote --tags origin | grep -E 'refs/tags/v[0-9]+(\.[0-9]+)*$' | sed 's|.*refs/tags/||' | sort -V | tail -n1 || echo "unknown") @@ -239,12 +239,46 @@ perform_update() { # Perform the update local update_error="" { - # Pull latest changes - git fetch --tags origin 2>&1 || { update_error="Failed to fetch from remote"; return 1; } - git checkout "$remote_version" 2>&1 || { update_error="Failed to checkout version $remote_version"; return 1; } + # Pull latest changes (instead of checkout) + git pull origin main 2>&1 || { update_error="Failed to pull from origin main"; return 1; } - # Run the installer to update files - HERMES_DIR="$hermes_dir" UPDATE_MODE=true ./install.sh --non-interactive 2>&1 + # Copy plugin files directly (lines 448-466) + PLUGIN_DST="$hermes_dir/plugins/platforms/rocketchat" + mkdir -p "$PLUGIN_DST" + + # Rekursiv kopieren (inkl. Submodule wie archivar/), __pycache__ ausschließen + if [ -d "$script_dir/plugin" ]; then + # Lösche vorherige Dateien NICHT — das könnte andere Submodule zerstören + # Kopiere ALLE Dateien aus plugin/ rekursiv (behält Struktur) + find "$script_dir/plugin" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' \ + | while read -r src; do + rel="${src#$script_dir/plugin/}" + dst="$PLUGIN_DST/$rel" + mkdir -p "$(dirname "$dst")" + cp "$src" "$dst" + done + copied_count=$(find "$script_dir/plugin" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' | wc -l) + msg copied "$copied_count" + fi + + # Execute backend checks directly (Ollama check from lines 429-446) + msg ollama_check + if command -v ollama >/dev/null 2>&1; then + msg ollama_ok + # nomic-embed-text laden falls nicht vorhanden + if ! ollama list 2>/dev/null | grep -q nomic-embed-text; then + msg nomic_pull + if ollama pull nomic-embed-text 2>/dev/null; then + msg nomic_ok + else + msg nomic_fail + fi + else + msg nomic_ok + fi + else + msg ollama_missing + fi } || { # Update failed, rollback if [ -n "$update_error" ]; then