fix: allow empty custom modules dir (#77)

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
This commit is contained in:
qoijjj 2024-02-22 12:49:45 -08:00 committed by GitHub
parent 8931a22e29
commit 681aab4a85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -224,6 +224,11 @@ fn get_gitlab_registry_path() -> Option<String> {
)
}
fn modules_exists() -> bool {
let mod_path = Path::new("modules");
mod_path.exists() && mod_path.is_dir()
}
#[derive(Debug, Clone, TypedBuilder, PartialEq, Eq, Hash)]
struct AkmodsInfo {
images: (String, Option<String>),

View file

@ -10,7 +10,9 @@ COPY ./config /config
# Custom modules overwrite defaults
FROM scratch as stage-modules
COPY --from=ghcr.io/ublue-os/bling:latest /modules /modules
{%- if self::modules_exists() %}
COPY ./modules /modules
{%- endif %}
{%- for info in self::get_akmods_info_list(recipe.modules_ext, os_version) %}
FROM scratch as stage-akmods-{{ info.stage_name }}