mirror of
https://gitlab.com/TECHNOFAB/soonix.git
synced 2025-12-10 21:30:06 +01:00
fix(generator): fix leading newline in generated json files
This commit is contained in:
parent
e04b71c074
commit
078034b01e
3 changed files with 15 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -3,4 +3,5 @@ result
|
|||
|
||||
# soonix
|
||||
/test.yaml
|
||||
/test.json
|
||||
# end soonix
|
||||
|
|
|
|||
10
lib/lib.nix
10
lib/lib.nix
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
autogeneratedMessage =
|
||||
{
|
||||
yaml = "# Generated by soonix, DO NOT EDIT";
|
||||
toml = "# Generated by soonix, DO NOT EDIT";
|
||||
lua = "--- Generated by soonix, DO NOT EDIT";
|
||||
xml = "<!-- Generated by soonix, DO NOT EDIT -->";
|
||||
yaml = "# Generated by soonix, DO NOT EDIT\n";
|
||||
toml = "# Generated by soonix, DO NOT EDIT\n";
|
||||
lua = "--- Generated by soonix, DO NOT EDIT\n";
|
||||
xml = "<!-- Generated by soonix, DO NOT EDIT -->\n";
|
||||
}.${
|
||||
format
|
||||
} or "";
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
''
|
||||
${pre.buildCommand}
|
||||
cp $out tmp
|
||||
cat <(echo "${autogeneratedMessage}") tmp > $out
|
||||
cat <(echo -n "${autogeneratedMessage}") tmp > $out
|
||||
'';
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -22,5 +22,14 @@ in
|
|||
gitignore = true;
|
||||
};
|
||||
};
|
||||
testJson = {
|
||||
output = "test.json";
|
||||
data.hello = "world";
|
||||
opts.format = "json";
|
||||
hook = {
|
||||
mode = "copy";
|
||||
gitignore = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}).config
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue