diff --git a/install.sh b/install.sh index 6eef1d9..cebab51 100644 --- a/install.sh +++ b/install.sh @@ -47,7 +47,8 @@ process_package() { display_name=$(echo "${config_value}" | cut -d'|' -f1) remote_version=$(echo "${config_value}" | cut -d'|' -f2) description=$(echo "${config_value}" | cut -d'|' -f3) - urls_to_download=$(echo "${config_value}" | cut -d'|' -f4-) + urls_to_download=$(echo "${config_value}" | cut -d'|' -f4) + install_script=$(echo "${config_value}" | cut -d'|' -f5) # Optional install script read -r -a urls_to_download_array <<< "$urls_to_download" @@ -101,6 +102,16 @@ process_package() { fi fi done + + if [[ -n "${install_script}" ]]; then + echo "[⚙️] Running install script for '${choice_key}'..." + eval "${install_script}" + if [ $? -eq 0 ]; then + echo "[✅] Install script completed successfully." + else + echo "[❌] Install script failed with exit code $?." + fi + fi echo "[📦] Package processing complete for '${choice_key}'." } @@ -173,7 +184,8 @@ for i in "${!ordered_keys[@]}"; do display_name=$(echo "${config_value}" | cut -d'|' -f1) remote_version=$(echo "${config_value}" | cut -d'|' -f2) description=$(echo "${config_value}" | cut -d'|' -f3) - urls=$(echo "${config_value}" | cut -d'|' -f4-) + urls=$(echo "${config_value}" | cut -d'|' -f4) + # install_script=$(echo "${config_value}" | cut -d'|' -f5) # Not used for display in menu read -r -a url_array <<< "$urls" main_script_filename=$(basename "${url_array[0]}") local_version=$(get_local_version "${main_script_filename}") diff --git a/packages.conf b/packages.conf index 87ebaab..3c5a19d 100644 --- a/packages.conf +++ b/packages.conf @@ -3,7 +3,8 @@ # This file contains the configuration for the script downloader. # The `SCRIPT_PACKAGES` associative array maps a short package name # to a pipe-separated string with the following format: -# "|||" +# "||||[Install Script (optional)]" +# The Install Script will be executed after all files for the package are downloaded. declare -A SCRIPT_PACKAGES