Skip to content

Commit

Permalink
export: consider only absolute candidate icon paths that exist
Browse files Browse the repository at this point in the history
Previously (for nearly two years?) attempting e.g.
"distrobox-export -a htop" with a file/dir named "htop" in $PWD it would
mistakenly get detected as the icon for the program, copied over to
~/.local/share/icons/ and attempted to be used by the .desktop file.
  • Loading branch information
JamiKettunen committed Mar 30, 2024
1 parent 867f4f8 commit ef1f98c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion distrobox-export
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ export_application() {
icon_name="$(grep Icon= "${desktop_file}" | cut -d'=' -f2- | paste -sd "@" -)"

for icon in ${icon_name}; do
if [ -e "${icon_name}" ]; then
if case "${icon_name}" in "/"*) true ;; *) false ;; esac &&
[ -e "${icon_name}" ]; then
# In case it's an hard path, conserve it and continue
icon_files="${icon_files}@${icon_name}"
else
Expand Down

0 comments on commit ef1f98c

Please sign in to comment.