From a05b84f046f280e1cfb69b9578d7cc27ac0a1908 Mon Sep 17 00:00:00 2001 From: PickleRick Date: Wed, 30 Sep 2026 18:03:23 +0200 Subject: [PATCH] fix(install.sh): remove references to deleted 2.0.0 versions and install all FlowHelpers --- install.sh | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/install.sh b/install.sh index 4ce388e..3ade69c 100644 --- a/install.sh +++ b/install.sh @@ -75,14 +75,6 @@ download_plugin() { fi local versions="1.0.0" - if [[ "$VERSION_MODE" == "all" ]]; then - case "$name" in - copyToWorkDir) versions="1.0.0 2.0.0" ;; - replaceOriginalFile) versions="1.0.0 2.0.0" ;; - esac - elif [[ "$name" == "copyToWorkDir" || "$name" == "replaceOriginalFile" ]]; then - versions="2.0.0" - fi for version in $versions; do local dest="${PLUGIN_DIR}/LocalFlowPlugins/${category}/${name}/${version}" @@ -98,16 +90,29 @@ download_plugin() { done } -download_progress_helper() { +download_flow_helpers() { local dest="${PLUGIN_DIR}/FlowHelpers/1.0.0" - local url="${RAW}/FlowHelpers/1.0.0/copyWithProgress.js" + local helpers=("copyWithProgress.js" "cliUtils.js" "fileUtils.js") mkdir -p "$dest" - if curl -fsSL "$url" -o "${dest}/copyWithProgress.js"; then - echo " ✓ copyWithProgress helper → ${dest}/copyWithProgress.js" - else - echo " ✗ Failed to download copyWithProgress helper from ${url}" - return 1 - fi + for helper in "${helpers[@]}"; do + local url="${RAW}/FlowHelpers/1.0.0/${helper}" + if curl -fsSL "$url" -o "${dest}/${helper}"; then + echo " ✓ FlowHelper ${helper} → ${dest}/${helper}" + else + echo " ✗ Failed to download ${helper} from ${url}" + return 1 + fi + done +} + +clean_deprecated_plugins() { + for deprecated in copyToWorkDir replaceOriginalFile; do + local dep_dir="${PLUGIN_DIR}/LocalFlowPlugins/utility/${deprecated}/2.0.0" + if [[ -d "$dep_dir" ]]; then + rm -rf "$dep_dir" + echo " 🗑️ Removed deprecated ${deprecated} 2.0.0" + fi + done } # ── Run ─────────────────────────────────────────────────────────────────────── @@ -117,15 +122,13 @@ echo " Target : ${PLUGIN_DIR}" echo "" ERRORS=0 +clean_deprecated_plugins + for plugin in "${TARGETS[@]}"; do download_plugin "$plugin" || ERRORS=$((ERRORS + 1)) done -if [[ "$VERSION_MODE" == "all" - || " ${TARGETS[*]} " == *" copyToWorkDir "* - || " ${TARGETS[*]} " == *" replaceOriginalFile "* ]]; then - download_progress_helper || ERRORS=$((ERRORS + 1)) -fi +download_flow_helpers || ERRORS=$((ERRORS + 1)) echo "" if [[ $ERRORS -eq 0 ]]; then