♻ (flatpak-sync) Put code in own method

The new method sync is at this point always called
This commit is contained in:
Marcel Kapfer 2023-07-20 21:06:42 +02:00
parent c514a973b9
commit 0a66eb9fb6
Signed by: mmk2410
GPG Key ID: CADE6F0C09F21B09
1 changed files with 25 additions and 21 deletions

View File

@ -9,6 +9,7 @@ set -euo pipefail
APPS_LIST_PATH="${APPS_LIST_PATH:=$HOME/.config/flatpak-sync/apps.list}"
function sync() {
readarray -t requested_apps < <(cat "$APPS_LIST_PATH")
readarray -t installed_apps < <(flatpak list --app --columns app | tail -n +1)
@ -33,3 +34,6 @@ for app in "${installed_apps[@]}"; do
flatpak uninstall -y "$app"
fi
done
}
sync