element-web: escape JSON string

Previously, if any part of the configuration (either key or value)
contained a single quote ('), the build would fail.
This commit is contained in:
Diogo Correia
2024-12-31 19:47:34 +00:00
parent 0e82ab2342
commit 77e361e9f8
+2 -1
View File
@@ -1,4 +1,5 @@
{
lib,
stdenv,
jq,
element-web-unwrapped,
@@ -22,7 +23,7 @@ else
mkdir -p $out
ln -s ${element-web-unwrapped}/* $out
rm $out/config.json
jq -s '.[0] * $conf' "${element-web-unwrapped}/config.json" --argjson "conf" '${builtins.toJSON conf}' > "$out/config.json"
jq -s '.[0] * $conf' "${element-web-unwrapped}/config.json" --argjson "conf" ${lib.escapeShellArg (builtins.toJSON conf)} > "$out/config.json"
runHook postInstall
'';