Move puppeteer-config.json to config directory.

This commit is contained in:
voidking 2023-07-30 15:45:44 +08:00
parent 299ab5d685
commit 7526d59b79
4 changed files with 8 additions and 11 deletions

View file

@ -16,8 +16,6 @@ from metagpt.utils.common import check_cmd_exists
IS_DOCKER = os.environ.get('AM_I_IN_A_DOCKER_CONTAINER', 'false').lower()
def mermaid_to_file(mermaid_code, output_file_without_suffix, width=2048, height=2048) -> int:
"""suffix: png/svg/pdf
@ -41,15 +39,15 @@ def mermaid_to_file(mermaid_code, output_file_without_suffix, width=2048, height
# Call the `mmdc` command to convert the Mermaid code to a PNG
logger.info(f"Generating {output_file}..")
if IS_DOCKER == 'true':
subprocess.run(['mmdc', '-p', '/app/metagpt/puppeteer-config.json', '-i',
subprocess.run(['mmdc', '-p', '/app/metagpt/config/puppeteer-config.json', '-i',
str(tmp), '-o', output_file, '-w', str(width), '-H', str(height)])
else:
if CONFIG.puppeteer_config:
subprocess.run([CONFIG.mmdc,'-p',CONFIG.puppeteer_config, '-i', str(tmp), '-o',
output_file, '-w', str(width), '-H', str(height)])
subprocess.run([CONFIG.mmdc, '-p', CONFIG.puppeteer_config, '-i', str(tmp), '-o',
output_file, '-w', str(width), '-H', str(height)])
else:
subprocess.run( [CONFIG.mmdc, '-i', str(tmp), '-o',
output_file, '-w', str(width), '-H', str(height)])
subprocess.run([CONFIG.mmdc, '-i', str(tmp), '-o',
output_file, '-w', str(width), '-H', str(height)])
return 0