testando pós scripts
This commit is contained in:
1 parent
0a2815a731
commit
f7ff164eb9
284 files changed
+6500484
-656933
No files matched your search
@@ -3,11 +3,12 @@
|
||||
import os
|
||||
import json
|
||||
import logging
|
||||
import yaml # <--- Requer: pip install pyyaml
|
||||
import yaml
|
||||
|
||||
# Caminhos relativos baseados na raiz do projeto passada como argumento
|
||||
from utils import CONFIGS, scan_directory_list, scan_directory_tree
|
||||
|
||||
|
||||
def generate_manifests(project_root_path):
|
||||
"""
|
||||
Gera os manifestos e retorna um dicionário com estatísticas.
|
||||
@@ -41,9 +42,13 @@ def generate_manifests(project_root_path):
|
||||
|
||||
# DECISÃO: Salvar como YAML ou JSON baseado na extensão
|
||||
with open(output_file_abs, "w", encoding="utf-8") as f:
|
||||
if output_file_abs.endswith(".yml") or output_file_abs.endswith(".yaml"):
|
||||
if output_file_abs.endswith(".yml") or output_file_abs.endswith(
|
||||
".yaml"
|
||||
):
|
||||
# allow_unicode=True é CRUCIAL para acentos funcionarem
|
||||
yaml.dump(result_data, f, allow_unicode=True, default_flow_style=False)
|
||||
yaml.dump(
|
||||
result_data, f, allow_unicode=True, default_flow_style=False
|
||||
)
|
||||
else:
|
||||
json.dump(result_data, f, indent=2, ensure_ascii=False)
|
||||
|
||||
@@ -54,4 +59,4 @@ def generate_manifests(project_root_path):
|
||||
logging.error(f"Erro ao gerar {config['output_file']}: {e}")
|
||||
report["failed"].append(f"{config['output_file']} (Erro: {str(e)})")
|
||||
|
||||
return report
|
||||
return report
|
||||
Reference in new issue
Block a user