Merge pull request 'ClanModules: make all module available to inventory' (#2095) from hsjobeki/clan-core:hsjobeki-main into main
This commit is contained in:
@@ -28,7 +28,7 @@ import os
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from clan_cli.api.modules import Frontmatter, extract_frontmatter, get_roles
|
||||
from clan_cli.api.modules import Frontmatter, extract_frontmatter
|
||||
from clan_cli.errors import ClanError
|
||||
|
||||
# Get environment variables
|
||||
@@ -277,9 +277,9 @@ def produce_clan_modules_docs() -> None:
|
||||
output += f"{readme_content}\n"
|
||||
|
||||
# get_roles(str) -> list[str] | None
|
||||
roles = get_roles(CLAN_CORE_PATH / "clanModules" / module_name)
|
||||
if roles:
|
||||
output += render_roles(roles, module_name)
|
||||
# roles = get_roles(CLAN_CORE_PATH / "clanModules" / module_name)
|
||||
# if roles:
|
||||
# output += render_roles(roles, module_name)
|
||||
|
||||
output += module_usage(module_name)
|
||||
|
||||
|
||||
@@ -135,6 +135,8 @@ let
|
||||
in
|
||||
if builtins.pathExists path then
|
||||
path
|
||||
else if role == "default" then
|
||||
{ }
|
||||
else
|
||||
throw "Module doesn't have role: '${role}'. Path: ${path} not found."
|
||||
) inverseRoles.${machineName} or [ ];
|
||||
|
||||
@@ -96,7 +96,7 @@ let
|
||||
let
|
||||
roles = getRoles self.clanModules.${moduleName};
|
||||
in
|
||||
if roles == null then [ ] else roles;
|
||||
if roles == null then [ "default" ] else roles;
|
||||
moduleServices = lib.mapAttrs moduleToService (
|
||||
lib.filterAttrs (n: _v: rolesOf n != [ ]) modulesSchema
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user