Throw error on missing clanModule description or if description too long. Add xfce description.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ clan-core, ... }:
|
||||
{ lib, clan-core, ... }:
|
||||
|
||||
rec {
|
||||
getReadme =
|
||||
@@ -17,10 +17,17 @@ rec {
|
||||
modulename:
|
||||
let
|
||||
content = (getReadme modulename);
|
||||
parts = builtins.split "---" content;
|
||||
parts = lib.splitString "---" content;
|
||||
description = builtins.head parts;
|
||||
number_of_newlines = builtins.length (lib.splitString "\n" description);
|
||||
in
|
||||
if (builtins.length parts) > 0 then
|
||||
builtins.head parts
|
||||
if (builtins.length parts) > 1 then
|
||||
if number_of_newlines > 4 then
|
||||
throw "Short description in README.md for module ${modulename} is too long. Max 3 newlines."
|
||||
else if number_of_newlines <= 1 then
|
||||
throw "Missing short description in README.md for module ${modulename}."
|
||||
else
|
||||
description
|
||||
else
|
||||
throw "Short description delimiter `---` not found in README.md for module ${modulename}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user