From 8cd2bb5abf010969121130f42d3e35ae0aad3f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20H=C3=A9risson?= Date: Tue, 16 Dec 2025 00:01:43 +0100 Subject: [PATCH] feat(rpthermo): create output folder if does not exist --- rptools/rpthermo/__main__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rptools/rpthermo/__main__.py b/rptools/rpthermo/__main__.py index 833e365..ece1fd1 100644 --- a/rptools/rpthermo/__main__.py +++ b/rptools/rpthermo/__main__.py @@ -4,6 +4,10 @@ Logger, getLogger ) +from os import ( + makedirs as os_makedirs, + path as os_path +) from typing import Dict from colored import fg, bg, attr from rptools.rpthermo import runThermo @@ -53,6 +57,8 @@ def _cli(): # Print results print_results(pathway, results, logger) # Write pathway into file + # Create the output directory if not exists + os_makedirs(os_path.dirname(args.outfile), exist_ok=True) pathway.to_rpSBML().write_to_file(args.outfile) logger.info( "{color}{typo}Written into file: {file}{rst}".format(