sublime4,sublime-merge: Use --replace-fail

Also split the substitute call for legibility.
This commit is contained in:
Jan Tojnar 2024-04-04 15:40:20 +02:00
parent 86c02994a0
commit eb7298e58b
2 changed files with 12 additions and 2 deletions

View file

@ -158,7 +158,12 @@ stdenv.mkDerivation (rec {
)
+ ''
mkdir -p "$out/share/applications"
substitute "''$${primaryBinary}/${primaryBinary}.desktop" "$out/share/applications/${primaryBinary}.desktop" --replace "/opt/${primaryBinary}/${primaryBinary}" "${primaryBinary}"
substitute \
"''$${primaryBinary}/${primaryBinary}.desktop" \
"$out/share/applications/${primaryBinary}.desktop" \
--replace-fail "/opt/${primaryBinary}/${primaryBinary}" "${primaryBinary}"
for directory in ''$${primaryBinary}/Icon/*; do
size=$(basename $directory)
mkdir -p "$out/share/icons/hicolor/$size/apps"

View file

@ -161,7 +161,12 @@ stdenv.mkDerivation (rec {
)
+ ''
mkdir -p "$out/share/applications"
substitute "''$${primaryBinary}/${primaryBinary}.desktop" "$out/share/applications/${primaryBinary}.desktop" --replace "/opt/${primaryBinary}/${primaryBinary}" "${primaryBinary}"
substitute \
"''$${primaryBinary}/${primaryBinary}.desktop" \
"$out/share/applications/${primaryBinary}.desktop" \
--replace-fail "/opt/${primaryBinary}/${primaryBinary}" "${primaryBinary}"
for directory in ''$${primaryBinary}/Icon/*; do
size=$(basename $directory)
mkdir -p "$out/share/icons/hicolor/$size/apps"