Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab6558b

Browse files
committed
fix: ensure directory exists before saving generation summary file
added a check to create the directory for the summary file if it does not exist, improving file handling and preventing potential errors during the save operation.
1 parent4468533 commitab6558b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎projects/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*.*
1+
*

‎src/cli/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,12 @@ def progress_callback(step, total_steps, message):
489489
summary_filename=f"{project_name}_generation_summary.json"
490490
summary_filepath=os.path.join(project_folder,summary_filename)
491491
withconsole.status(f"[bold]Saving generation summary to file...[/bold]"):
492+
# Ensure the directory exists before writing the file
493+
summary_dir=os.path.dirname(summary_filepath)
494+
ifsummary_dirandnotos.path.exists(summary_dir):
495+
console.print(f"[dim]Creating directory for summary file:{summary_dir}[/dim]")
496+
os.makedirs(summary_dir,exist_ok=True)
497+
492498
withopen(summary_filepath,"w")asf:
493499
json.dump(result,f,indent=2)
494500
time.sleep(0.5)# Brief pause for effect

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp