Skip to content

Commit

Permalink
export: Fix XDG_DATA_DIRS and XDG_DATA_HOME handling (#1496)
Browse files Browse the repository at this point in the history
Swaps if condition resulting in the matching environment variable being
iterated
  • Loading branch information
e-luks authored Oct 10, 2024
1 parent 771370b commit ccedbd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distrobox-export
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export_application()
desktop_files="${exported_app}"
else
IFS=":"
if [ -n "${XDG_DATA_DIRS}" ]; then
if [ -n "${XDG_DATA_HOME}" ]; then
for xdg_data_home in ${XDG_DATA_HOME}; do
[ -d "${xdg_data_home}/applications" ] && canon_dirs="${canon_dirs} ${xdg_data_home}/applications"
done
Expand All @@ -434,7 +434,7 @@ export_application()
[ -d /usr/local/share/applications ] && canon_dirs="${canon_dirs} /usr/local/share/applications"
[ -d /var/lib/flatpak/exports/share/applications ] && canon_dirs="${canon_dirs} /var/lib/flatpak/exports/share/applications"
fi
if [ -n "${XDG_DATA_HOME}" ]; then
if [ -n "${XDG_DATA_DIRS}" ]; then
for xdg_data_dir in ${XDG_DATA_DIRS}; do
[ -d "${xdg_data_dir}/applications" ] && canon_dirs="${canon_dirs} ${xdg_data_dir}/applications"
done
Expand Down

0 comments on commit ccedbd7

Please sign in to comment.