P-043c: install.sh — venv/ + .pytest_cache/ vom Deployment ausschließen (~200MB Bloat)
This commit is contained in:
+17
-2
@@ -417,12 +417,13 @@ deploy_plugin() {
|
|||||||
# Rekursives Kopieren, __pycache__/*.pyc + Stray ~/ ausschließen
|
# Rekursives Kopieren, __pycache__/*.pyc + Stray ~/ ausschließen
|
||||||
# Erkenntnis 3: Stray-Verzeichnis ~/ im Dev-Repo ausschließen
|
# Erkenntnis 3: Stray-Verzeichnis ~/ im Dev-Repo ausschließen
|
||||||
# Erkenntnis 4: find+cp statt tar (zuverlässigere Excludes)
|
# Erkenntnis 4: find+cp statt tar (zuverlässigere Excludes)
|
||||||
|
# P-043c: venv/ + .pytest_cache/ ausschließen (Dev-Artefakte, ~200MB Bloat)
|
||||||
while read -r f; do
|
while read -r f; do
|
||||||
rel="${f#$src/}"
|
rel="${f#$src/}"
|
||||||
target="$dst/$rel"
|
target="$dst/$rel"
|
||||||
mkdir -p "$(dirname "$target")"
|
mkdir -p "$(dirname "$target")"
|
||||||
cp "$f" "$target"
|
cp "$f" "$target"
|
||||||
done < <(find "$src" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' ! -path '*/~/*')
|
done < <(find "$src" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' ! -path '*/~/*' ! -path '*/venv/*' ! -path '*/.pytest_cache/*')
|
||||||
|
|
||||||
# pycache aufräumen
|
# pycache aufräumen
|
||||||
find "$dst" -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
|
find "$dst" -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
|
||||||
@@ -533,7 +534,7 @@ migrate_to_userspace() {
|
|||||||
target="$user_dst/$rel"
|
target="$user_dst/$rel"
|
||||||
mkdir -p "$(dirname "$target")"
|
mkdir -p "$(dirname "$target")"
|
||||||
cp "$f" "$target"
|
cp "$f" "$target"
|
||||||
done < <(find "$bundled_src" -type f ! -path '*/__pycache__/*' ! -name '*.pyc')
|
done < <(find "$bundled_src" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' ! -path '*/venv/*' ! -path '*/.pytest_cache/*')
|
||||||
ok "Plugin-Inhalt kopiert ($(find "$user_dst" -type f ! -path '*/__pycache__/*' | wc -l) Dateien)"
|
ok "Plugin-Inhalt kopiert ($(find "$user_dst" -type f ! -path '*/__pycache__/*' | wc -l) Dateien)"
|
||||||
|
|
||||||
# c) Alten Bundled-Pfad leeren (NICHT das Verzeichnis selbst löschen)
|
# c) Alten Bundled-Pfad leeren (NICHT das Verzeichnis selbst löschen)
|
||||||
@@ -1646,6 +1647,20 @@ if $UPDATE_ONLY; then
|
|||||||
rm -rf "$HOME/.hermes/plugins/rocketchat"
|
rm -rf "$HOME/.hermes/plugins/rocketchat"
|
||||||
log "Stale ~/.hermes/plugins/rocketchat/ gelöscht (alter falscher Pfad)"
|
log "Stale ~/.hermes/plugins/rocketchat/ gelöscht (alter falscher Pfad)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# P-043c: Stale venv/ + .pytest_cache/ aus altem Deploy bereinigen
|
||||||
|
if [ -d "$_update_dst/archivar/venv" ]; then
|
||||||
|
rm -rf "$_update_dst/archivar/venv"
|
||||||
|
log "Stale archivar/venv/ gelöscht (P-043c: Dev-Artefakt, ~200MB)"
|
||||||
|
fi
|
||||||
|
if [ -d "$_update_dst/.pytest_cache" ]; then
|
||||||
|
rm -rf "$_update_dst/.pytest_cache"
|
||||||
|
log "Stale .pytest_cache/ gelöscht (P-043c)"
|
||||||
|
fi
|
||||||
|
if [ -d "$_update_dst/archivar/.pytest_cache" ]; then
|
||||||
|
rm -rf "$_update_dst/archivar/.pytest_cache"
|
||||||
|
log "Stale archivar/.pytest_cache/ gelöscht (P-043c)"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
printf '%s[dry]%s find %s -type d -name __pycache__ -exec rm -rf {} +\n' "$C_YELLOW" "$C_RESET" "$_update_dst"
|
printf '%s[dry]%s find %s -type d -name __pycache__ -exec rm -rf {} +\n' "$C_YELLOW" "$C_RESET" "$_update_dst"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user