From 7eac6b7dbae2d78b7005ddb68e5ddf58f3a367a3 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 4 Jun 2026 08:04:03 +0200 Subject: [PATCH] Fix: replace find|while pipe with process substitution in perform_update() and main script This fixes the issue where cp and mkdir in the while loop were running in a subshell due to pipe usage, preventing proper error propagation with 'set -euo pipefail'. Using process substitution ensures the while loop runs in the main process. --- install.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 218e545..c384f20 100644 --- a/install.sh +++ b/install.sh @@ -250,13 +250,12 @@ perform_update() { 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 + while read -r src; do rel="${src#$script_dir/plugin/}" dst="$PLUGIN_DST/$rel" mkdir -p "$(dirname "$dst")" cp "$src" "$dst" - done + done < <(find "$script_dir/plugin" -type f ! -path '*/__pycache__/*' ! -name '*.pyc') copied_count=$(find "$script_dir/plugin" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' | wc -l) msg copied "$copied_count" fi @@ -488,13 +487,12 @@ mkdir -p "$PLUGIN_DST" 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 + while read -r src; do rel="${src#$SCRIPT_DIR/plugin/}" dst="$PLUGIN_DST/$rel" mkdir -p "$(dirname "$dst")" cp "$src" "$dst" - done + done < <(find "$SCRIPT_DIR/plugin" -type f ! -path '*/__pycache__/*' ! -name '*.pyc') copied_count=$(find "$SCRIPT_DIR/plugin" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' | wc -l) msg copied "$copied_count" fi