Skip to content

Commit

Permalink
Update flattool
Browse files Browse the repository at this point in the history
Speedup orphans command by making it store the flatpak list as a variable instead of running that multiple times.
  • Loading branch information
heliguy4599 authored Aug 14, 2023
1 parent 1c27880 commit 4d4b913
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flattool
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,11 @@ purgeApp() {

fixOrphans() {
echo "Checking '~/.var/app' for orphaned folders..."
appsList="$(flatpak list)"
orphanedAppsList=()
for element in "$HOME/.var/app/"*; do
element=$(basename "$element")
foundApp=$(flatpak list | grep -i "$element")
foundApp=$(grep -i "$element" <<< "$appsList")
if [ -z "$foundApp" ]; then
orphanedAppsList+=( "$element" )
fi
Expand Down

0 comments on commit 4d4b913

Please sign in to comment.