mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
Reapply "lib/strings.concatLines: call concatStringsSep directly"
But also handle empty lists. This effectively reapplies commitd7e6988c9bwhich was reverted by commit66f4e5d988. Co-authored-by: Eman Resu <78693624+quatquatt@users.noreply.github.com>
This commit is contained in:
@@ -337,7 +337,6 @@ rec {
|
||||
|
||||
/**
|
||||
Concatenate a list of strings, adding a newline at the end of each one.
|
||||
Defined as `concatMapStrings (s: s + "\n")`.
|
||||
|
||||
# Inputs
|
||||
|
||||
@@ -361,7 +360,7 @@ rec {
|
||||
|
||||
:::
|
||||
*/
|
||||
concatLines = concatMapStrings (s: s + "\n");
|
||||
concatLines = lines: optionalString (lines != [ ]) (concatStringsSep "\n" lines + "\n");
|
||||
|
||||
/**
|
||||
Given string `s`, replace every occurrence of the string `from` with the string `to`.
|
||||
|
||||
Reference in New Issue
Block a user