From 7e164fcc219cec14778df5efd9494edce57bfebf Mon Sep 17 00:00:00 2001 From: fiftydinar <65243233+fiftydinar@users.noreply.github.com> Date: Sun, 27 Apr 2025 09:58:09 +0200 Subject: [PATCH] fix(gnome-extensions): Languages not installed in some extensions Logic for locale wasn't perfect, noticeable with "Bluetooth Battery Meter" extension, where languages weren't installed, but were available. This fixes it. --- modules/gnome-extensions/gnome-extensions.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/gnome-extensions/gnome-extensions.sh b/modules/gnome-extensions/gnome-extensions.sh index 4921bf4..ef26f1b 100644 --- a/modules/gnome-extensions/gnome-extensions.sh +++ b/modules/gnome-extensions/gnome-extensions.sh @@ -116,8 +116,8 @@ if [[ ${#INSTALL[@]} -gt 0 ]]; then # Some of them might not have any locale at the moment # So that's why I made a check for directory # I made an additional check if language files are available, in case if extension is packaged with an empty folder, like with Default Workspace extension - if [[ -d "${TMP_DIR}/locale" ]]; then - if find "${TMP_DIR}/locale/" -type f -name "*.mo" | grep -q .; then + if [[ -d "${TMP_DIR}/locale/" ]]; then + if find "${TMP_DIR}/locale/" -type f -name "*.mo" -print -quit | read; then echo "Installing language extension files" install -d -m 0755 "/usr/share/locale/" cp -r "${TMP_DIR}/locale"/* "/usr/share/locale/" @@ -225,8 +225,8 @@ if [[ ${#INSTALL[@]} -gt 0 ]] && ! "${LEGACY}"; then # Some of them might not have any locale at the moment # So that's why I made a check for directory # I made an additional check if language files are available, in case if extension is packaged with an empty folder, like with Default Workspace extension - if [[ -d "${TMP_DIR}/locale" ]]; then - if find "${TMP_DIR}/locale/" -type f -name "*.mo" | grep -q .; then + if [[ -d "${TMP_DIR}/locale/" ]]; then + if find "${TMP_DIR}/locale/" -type f -name "*.mo" -print -quit | read; then echo "Installing language extension files" install -d -m 0755 "/usr/share/locale/" cp -r "${TMP_DIR}/locale"/* "/usr/share/locale/"