Check if contain module id (#1128)

This commit is contained in:
Howard Wu
2023-11-12 12:34:18 +08:00
committed by GitHub
parent 8a298bb867
commit 88d4eca8ff

View File

@@ -663,7 +663,7 @@ fn _list_modules(path: &str) -> Vec<HashMap<String, String>> {
module_prop_map.insert(k, v);
});
if module_prop_map["id"].is_empty() {
if !module_prop_map.contains_key("id") || module_prop_map["id"].is_empty() {
if let Some(id) = entry.file_name().to_str() {
info!("Use dir name as module id: {}", id);
module_prop_map.insert("id".to_owned(), id.to_owned());