mirror of
https://github.com/flatpak/flatpak.git
synced 2026-01-03 13:28:08 -05:00
which(1) is not standardized by POSIX, and has different implementations and behaviour on different distributions. The behaviour and exit status of command -v is standardized by POSIX, and in particular, checking its exit status is an appropriate way to ask: if I called this command, would it be found? Signed-off-by: Simon McVittie <smcv@collabora.com>
14 lines
465 B
Bash
Executable File
14 lines
465 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if command -v gtk-update-icon-cache >/dev/null && test -d "$1/exports/share/icons/hicolor"; then
|
|
cp /usr/share/icons/hicolor/index.theme "$1/exports/share/icons/hicolor/"
|
|
for dir in "$1"/exports/share/icons/*; do
|
|
if test -f "$dir/index.theme"; then
|
|
if ! gtk-update-icon-cache --quiet "$dir"; then
|
|
echo "Failed to run gtk-update-icon-cache for $dir"
|
|
exit 1
|
|
fi
|
|
fi
|
|
done
|
|
fi
|