mirror of
https://github.com/nix-community/home-manager
synced 2024-12-20 16:59:47 +01:00
xdg-mime-apps: fix regex in mimeAssociations
The XDG Desktop Entry spec mentions that multiple values per key may be optionally terminated by a semicolon. An example for this is the Firefox desktop file, which has no trailing semicolon. This breaks the sed regex used in `mimeAssociations`. Fix the regex by matching the end of string, optionally preceded by a semicolon, or any other semicolon. This makes it work with both semicolon-terminated and non-semicolon-terminated desktop files.
This commit is contained in:
parent
dbed4c794d
commit
0b7fd187e2
1 changed files with 1 additions and 1 deletions
|
@ -94,7 +94,7 @@ in {
|
|||
for p in $ps ; do
|
||||
for path in "$p"/share/applications/*.desktop ; do
|
||||
name="''${path##*/}"
|
||||
sed -n "/^MimeType=/ { s/.*=//; s/;/;$name\n/g; p; }" "$path"
|
||||
sed -n -E "/^MimeType=/ { s/.*=//; s/;?$|;/;$name\n/g; p; }" "$path"
|
||||
done
|
||||
done > "$out"
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue