mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-05 16:02:14 +02:00
check mmdc via running in case of setup failed.
This commit is contained in:
parent
22fd9fd49a
commit
748ef5535a
2 changed files with 3 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ from metagpt.logs import logger
|
|||
from metagpt.utils.common import check_cmd_exists
|
||||
|
||||
|
||||
def mermaid_to_file(mermaid_code, output_file_without_suffix, width=2048, height=2048):
|
||||
def mermaid_to_file(mermaid_code, output_file_without_suffix, width=2048, height=2048) -> int:
|
||||
"""suffix: png/svg/pdf
|
||||
|
||||
:param mermaid_code: mermaid code
|
||||
|
|
@ -29,6 +29,7 @@ def mermaid_to_file(mermaid_code, output_file_without_suffix, width=2048, height
|
|||
tmp.write_text(mermaid_code, encoding='utf-8')
|
||||
|
||||
if check_cmd_exists('mmdc') != 0:
|
||||
logger.warning("RUN `npm install -g @mermaid-js/mermaid-cli` to install mmdc")
|
||||
return -1
|
||||
|
||||
for suffix in ['pdf', 'svg', 'png']:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue