mirror of
https://github.com/flatpak/flatpak.git
synced 2026-02-05 05:21:25 -05:00
If G_MESSAGES_DEBUG is set in the shell's start-up scripts, then the
"flatpak --installations" output is contaminated with these strings:
(flatpak:4558): flatpak-DEBUG: ...
Fallout from 30c2919624
Closes: #2673
Approved by: alexlarsson
25 lines
679 B
Bash
25 lines
679 B
Bash
# set XDG_DATA_DIRS to include Flatpak installations
|
|
|
|
new_dirs=$(
|
|
(
|
|
unset G_MESSAGES_DEBUG
|
|
echo "${XDG_DATA_HOME:-"$HOME/.local/share"}/flatpak"
|
|
flatpak --installations
|
|
) | (
|
|
new_dirs=
|
|
while read -r install_path
|
|
do
|
|
share_path=$install_path/exports/share
|
|
case ":$XDG_DATA_DIRS:" in
|
|
*":$share_path:"*) :;;
|
|
*":$share_path/:"*) :;;
|
|
*) new_dirs=${new_dirs:+${new_dirs}:}$share_path;;
|
|
esac
|
|
done
|
|
echo "$new_dirs"
|
|
)
|
|
)
|
|
|
|
export XDG_DATA_DIRS
|
|
XDG_DATA_DIRS="${new_dirs:+${new_dirs}:}${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
|