Compare commits

..

No commits in common. "921aa2e03343335a01b31bba2adcbb5149f85f26" and "c514a973b9fcd6df6a35bfc708816aafee5e9a99" have entirely different histories.

View file

@ -9,7 +9,6 @@ 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)
@ -21,7 +20,6 @@ function sync() {
continue
fi
requested_apps_cleaned+=("$app")
# shellcheck disable=SC2076
if [[ ! "${installed_apps[*]}" =~ "${app}" ]]; then
echo "$app not installed. Installing it."
flatpak install -y "$app"
@ -30,12 +28,8 @@ function sync() {
echo "Checking for apps to remove."
for app in "${installed_apps[@]}"; do
# shellcheck disable=SC2076
if [[ ! "${requested_apps_cleaned[*]}" =~ "${app}" ]]; then
echo "$app no found in apps list. Removing it.";
flatpak uninstall -y "$app"
fi
done
}
sync