Fix update flow: git pull statt checkout, Plugin-Dateien direkt kopieren, kein ./install.sh Selbstaufruf
This commit is contained in:
+40
-6
@@ -206,7 +206,7 @@ perform_update() {
|
|||||||
stashed=true
|
stashed=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get remote version
|
# Get remote version (for display only)
|
||||||
local remote_version
|
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")
|
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
|
# Perform the update
|
||||||
local update_error=""
|
local update_error=""
|
||||||
{
|
{
|
||||||
# Pull latest changes
|
# Pull latest changes (instead of checkout)
|
||||||
git fetch --tags origin 2>&1 || { update_error="Failed to fetch from remote"; return 1; }
|
git pull origin main 2>&1 || { update_error="Failed to pull from origin main"; return 1; }
|
||||||
git checkout "$remote_version" 2>&1 || { update_error="Failed to checkout version $remote_version"; return 1; }
|
|
||||||
|
|
||||||
# Run the installer to update files
|
# Copy plugin files directly (lines 448-466)
|
||||||
HERMES_DIR="$hermes_dir" UPDATE_MODE=true ./install.sh --non-interactive 2>&1
|
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
|
# Update failed, rollback
|
||||||
if [ -n "$update_error" ]; then
|
if [ -n "$update_error" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user