Clean up array building

This commit is contained in:
the-sane 2023-01-30 16:14:28 -05:00
parent c1dae30e5e
commit e6d79125a6

View File

@ -1148,9 +1148,9 @@ post_download() {
# We need to configure and restart Lutris # We need to configure and restart Lutris
unset lutris_game_ymls unset lutris_game_ymls
# Build an array of all Lutris Star Citizen yml files # Build an array of all Lutris Star Citizen yml files
while IFS= read -rd ''; do while IFS='' read -r line; do
lutris_game_ymls+=("$REPLY") lutris_game_ymls+=("$line")
done < <(grep -RlZ --include="*.yml" "Roberts Space Industries/RSI Launcher/RSI Launcher.exe" "$lutris_native_conf_dir" "$lutris_flatpak_conf_dir" 2>/dev/null) 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 # We handle installs and deletions differently
if [ "$download_action_success" = "installed" ]; then if [ "$download_action_success" = "installed" ]; then
@ -1602,8 +1602,11 @@ download_select_install() {
# Fetch a list of versions from the selected contributor # Fetch a list of versions from the selected contributor
# To add new sources, handle them here, in the if statement # To add new sources, handle them here, in the if statement
# just above, and the download_install function above # just above, and the download_install function above
unset download_versions
if [ "$download_url_type" = "github" ]; then 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 else
debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting." debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting."
fi fi