mirror of
https://gitlab.com/TECHNOFAB/soonix.git
synced 2025-12-11 22:00:05 +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
|
# soonix
|
||||||
/test.yaml
|
/test.yaml
|
||||||
|
/test.json
|
||||||
# end soonix
|
# end soonix
|
||||||
|
|
|
||||||
10
lib/lib.nix
10
lib/lib.nix
|
|
@ -17,10 +17,10 @@
|
||||||
|
|
||||||
autogeneratedMessage =
|
autogeneratedMessage =
|
||||||
{
|
{
|
||||||
yaml = "# Generated by soonix, DO NOT EDIT";
|
yaml = "# Generated by soonix, DO NOT EDIT\n";
|
||||||
toml = "# Generated by soonix, DO NOT EDIT";
|
toml = "# Generated by soonix, DO NOT EDIT\n";
|
||||||
lua = "--- Generated by soonix, DO NOT EDIT";
|
lua = "--- Generated by soonix, DO NOT EDIT\n";
|
||||||
xml = "<!-- Generated by soonix, DO NOT EDIT -->";
|
xml = "<!-- Generated by soonix, DO NOT EDIT -->\n";
|
||||||
}.${
|
}.${
|
||||||
format
|
format
|
||||||
} or "";
|
} or "";
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
''
|
''
|
||||||
${pre.buildCommand}
|
${pre.buildCommand}
|
||||||
cp $out tmp
|
cp $out tmp
|
||||||
cat <(echo "${autogeneratedMessage}") tmp > $out
|
cat <(echo -n "${autogeneratedMessage}") tmp > $out
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,5 +22,14 @@ in
|
||||||
gitignore = true;
|
gitignore = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
testJson = {
|
||||||
|
output = "test.json";
|
||||||
|
data.hello = "world";
|
||||||
|
opts.format = "json";
|
||||||
|
hook = {
|
||||||
|
mode = "copy";
|
||||||
|
gitignore = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}).config
|
}).config
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue