fix(gnome-extensions): Don't fail if extension is supplied with empty locale folder
Fixes installation of Default Workspace extension, which is packages with an empty `locale` folder.
This commit is contained in:
parent
797519720b
commit
4ac40ed042
1 changed files with 12 additions and 6 deletions
|
|
@ -115,10 +115,13 @@ if [[ ${#INSTALL[@]} -gt 0 ]]; then
|
|||
# Locale is not crucial for extensions to work, as they will fallback to gschema.xml
|
||||
# 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
|
||||
echo "Installing language extension files"
|
||||
install -d -m 0755 "/usr/share/locale/"
|
||||
cp -r "${TMP_DIR}/locale"/* "/usr/share/locale/"
|
||||
if ls "${TMP_DIR}/locale/"*.mo 1> /dev/null 2>&1; then
|
||||
echo "Installing language extension files"
|
||||
install -d -m 0755 "/usr/share/locale/"
|
||||
cp -r "${TMP_DIR}/locale"/* "/usr/share/locale/"
|
||||
fi
|
||||
fi
|
||||
# Delete the temporary directory
|
||||
echo "Cleaning up the temporary directory"
|
||||
|
|
@ -221,10 +224,13 @@ if [[ ${#INSTALL[@]} -gt 0 ]] && ! "${LEGACY}"; then
|
|||
# Locale is not crucial for extensions to work, as they will fallback to gschema.xml
|
||||
# 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
|
||||
echo "Installing language extension files"
|
||||
install -d -m 0755 "/usr/share/locale/"
|
||||
cp -r "${TMP_DIR}/locale"/* "/usr/share/locale/"
|
||||
if ls "${TMP_DIR}/locale/"*.mo 1> /dev/null 2>&1; then
|
||||
echo "Installing language extension files"
|
||||
install -d -m 0755 "/usr/share/locale/"
|
||||
cp -r "${TMP_DIR}/locale"/* "/usr/share/locale/"
|
||||
fi
|
||||
fi
|
||||
# Delete the temporary directory
|
||||
echo "Cleaning up the temporary directory"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue