From 57556078152c695f6c23fe0db41d8197130f3dac Mon Sep 17 00:00:00 2001 From: fiftydinar <65243233+fiftydinar@users.noreply.github.com> Date: Mon, 14 Oct 2024 23:13:48 +0200 Subject: [PATCH] chore(default-flatpaks): Use 1 for/done loop instead of 2 for user remote logic --- modules/default-flatpaks/v1/system-flatpak-setup | 10 +++++----- modules/default-flatpaks/v1/user-flatpak-setup | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/default-flatpaks/v1/system-flatpak-setup b/modules/default-flatpaks/v1/system-flatpak-setup index b3de46d..172e195 100755 --- a/modules/default-flatpaks/v1/system-flatpak-setup +++ b/modules/default-flatpaks/v1/system-flatpak-setup @@ -3,15 +3,15 @@ # Opt out of and remove Fedora's system flatpak repos FLATPAK_SYSTEM_REMOTES=($(flatpak --system remotes)) +fedora_system=false +fedora_testing_system=false + for system_remote in "${FLATPAK_SYSTEM_REMOTES[@]}"; do if [[ "${system_remote}" == "fedora" ]]; then fedora_system=true - fi -done -for system_remote in "${FLATPAK_SYSTEM_REMOTES[@]}"; do - if [[ "${system_remote}" == "fedora-testing" ]]; then + elif [[ "${system_remote}" == "fedora-testing" ]]; then fedora_testing_system=true - fi + fi done if rpm -q fedora-third-party &>/dev/null; then diff --git a/modules/default-flatpaks/v1/user-flatpak-setup b/modules/default-flatpaks/v1/user-flatpak-setup index 0d1b4b6..b8b3a6d 100755 --- a/modules/default-flatpaks/v1/user-flatpak-setup +++ b/modules/default-flatpaks/v1/user-flatpak-setup @@ -3,13 +3,13 @@ # Remove Fedora's flatpak user repos, if they exist FLATPAK_USER_REMOTES=($(flatpak --user remotes)) +fedora_user=false +fedora_testing_user=false + for user_remote in "${FLATPAK_USER_REMOTES[@]}"; do if [[ "${user_remote}" == "fedora" ]]; then - fedora_user=true - fi -done -for user_remote in "${FLATPAK_USER_REMOTES[@]}"; do - if [[ "${user_remote}" == "fedora-testing" ]]; then + fedora_user=true + elif [[ "${user_remote}" == "fedora-testing" ]]; then fedora_testing_user=true fi done