From e6d79125a64e32e2d0006e40043807836b724743 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 30 Jan 2023 16:14:28 -0500 Subject: [PATCH] Clean up array building --- lug-helper.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 8a2d923..788cfb6 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1148,9 +1148,9 @@ post_download() { # We need to configure and restart Lutris unset lutris_game_ymls # Build an array of all Lutris Star Citizen yml files - while IFS= read -rd ''; do - lutris_game_ymls+=("$REPLY") - done < <(grep -RlZ --include="*.yml" "Roberts Space Industries/RSI Launcher/RSI Launcher.exe" "$lutris_native_conf_dir" "$lutris_flatpak_conf_dir" 2>/dev/null) + while IFS='' read -r line; do + lutris_game_ymls+=("$line") + done < <(grep -Rl --include="*.yml" "Roberts Space Industries/RSI Launcher/RSI Launcher.exe" "$lutris_native_conf_dir" "$lutris_flatpak_conf_dir" 2>/dev/null) # We handle installs and deletions differently if [ "$download_action_success" = "installed" ]; then @@ -1602,8 +1602,11 @@ download_select_install() { # Fetch a list of versions from the selected contributor # To add new sources, handle them here, in the if statement # just above, and the download_install function above + unset download_versions if [ "$download_url_type" = "github" ]; then - download_versions=($(curl -s "$contributor_url" | awk '/browser_download_url/ {print $2}' | xargs basename -a)) + while IFS='' read -r line; do + download_versions+=("$line") + done < <(curl -s "$contributor_url" | awk '/browser_download_url/ {print $2}' | xargs basename -a) else debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting." fi