mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
formats.javaProperties: Add comment
This commit is contained in:
parent
4f8e44394c
commit
9a0739cbe2
@ -1,6 +1,6 @@
|
|||||||
{ lib, pkgs }:
|
{ lib, pkgs }:
|
||||||
{
|
{
|
||||||
javaProperties = {}: {
|
javaProperties = { comment ? "Generated with Nix" }: {
|
||||||
type = lib.types.attrsOf lib.types.str;
|
type = lib.types.attrsOf lib.types.str;
|
||||||
|
|
||||||
generate = name: value:
|
generate = name: value:
|
||||||
@ -76,10 +76,15 @@
|
|||||||
|
|
||||||
inputEncoding = "UTF-8";
|
inputEncoding = "UTF-8";
|
||||||
|
|
||||||
|
inherit comment;
|
||||||
|
|
||||||
} ''
|
} ''
|
||||||
jq -r --arg hash '#' "$jqCode" "$valuePath" \
|
(
|
||||||
| iconv --from-code "$inputEncoding" --to-code JAVA \
|
echo "$comment" | while read -r ln; do echo "# $ln"; done
|
||||||
> "$out"
|
echo
|
||||||
|
jq -r --arg hash '#' "$jqCode" "$valuePath" \
|
||||||
|
| iconv --from-code "$inputEncoding" --to-code JAVA \
|
||||||
|
) > "$out"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,8 @@ in runBuildTests {
|
|||||||
"الجبر" = "أكثر من مجرد أرقام";
|
"الجبر" = "أكثر من مجرد أرقام";
|
||||||
};
|
};
|
||||||
expected = ''
|
expected = ''
|
||||||
|
# Generated with Nix
|
||||||
|
|
||||||
1 = 2
|
1 = 2
|
||||||
foo = bar
|
foo = bar
|
||||||
\u00fctf\ 8 = d\u00fbh
|
\u00fctf\ 8 = d\u00fbh
|
||||||
|
Loading…
Reference in New Issue
Block a user