Skip to content

Commit

Permalink
export: minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
lribic committed Nov 9, 2023
1 parent cf0ff74 commit 993e66b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions distrobox-export
Original file line number Diff line number Diff line change
Expand Up @@ -384,17 +384,16 @@ export_application() {
icon_name="$(grep Icon= "${desktop_file}" | cut -d'=' -f2- | paste -sd "@" -)"

for icon in ${icon_name}; do
# In case it's an hard path, conserve it and continue
if [ -e "${icon_name}" ]; then
# In case it's an hard path, conserve it and continue
icon_files="${icon_files}@${icon_name}"
continue
else
# If it's not an hard path, find all files in the canonical paths.
icon_files="${icon_files}@$(find \
/usr/share/icons \
/usr/share/pixmaps \
/var/lib/flatpak/exports/share/icons -iname "*${icon}*")"
fi

# If it's not an hard path, find all files in the canonical paths.
icon_files="${icon_files}@$(find \
/usr/share/icons \
/usr/share/pixmaps \
/var/lib/flatpak/exports/share/icons -iname "*${icon}*")"
done

# remove leading delimiter
Expand Down

0 comments on commit 993e66b

Please sign in to comment.