Skip to content

Commit

Permalink
fix: use the mime package from snap to generate db (#231119)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 authored Oct 11, 2024
1 parent c373439 commit 2d28c0a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions resources/linux/snap/electron-launch
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ prepend_dir XDG_DATA_DIRS "$SNAP/data-dir"
prepend_dir XDG_DATA_DIRS "$SNAP_USER_DATA"

# Set XDG_DATA_HOME to local path
ensure_dir_exists "$SNAP_USER_DATA/.local/share"
export XDG_DATA_HOME="$SNAP_USER_DATA/.local/share"
ensure_dir_exists "$XDG_DATA_HOME"

# Workaround for GLib < 2.53.2 not searching for schemas in $XDG_DATA_HOME:
# https://bugzilla.gnome.org/show_bug.cgi?id=741335
prepend_dir XDG_DATA_DIRS "$SNAP_USER_DATA/.local/share"
prepend_dir XDG_DATA_DIRS "$XDG_DATA_HOME"

# Set cache folder to local path
if [[ -d "$SNAP_USER_DATA/.cache" && ! -e "$SNAP_USER_COMMON/.cache" ]]; then
Expand Down Expand Up @@ -169,11 +170,11 @@ IFS=':' read -r -a data_dirs_array <<< "$XDG_DATA_DIRS"
# Build mime.cache
# needed for gtk and qt icon
if [ "$needs_update" = true ]; then
rm -rf "$SNAP_USER_DATA/.local/share/mime"
rm -rf "$XDG_DATA_HOME/mime"
if [ ! -f "$SNAP/usr/share/mime/mime.cache" ]; then
if command -v update-mime-database >/dev/null; then
cp --preserve=timestamps -dR "$SNAP/usr/share/mime" "$SNAP_USER_DATA/.local/share"
async_exec update-mime-database "$SNAP_USER_DATA/.local/share/mime"
if command -v $SNAP/usr/bin/update-mime-database >/dev/null; then
cp --preserve=timestamps -dR "$SNAP/usr/share/mime" "$XDG_DATA_HOME"
async_exec $SNAP/usr/bin/update-mime-database "$XDG_DATA_HOME/mime"
fi
fi
fi
Expand Down

0 comments on commit 2d28c0a

Please sign in to comment.