Skip to content

Commit cc5fbe1

Browse files
committed
Fix bug with mirroring file prefixes
1 parent d330e1d commit cc5fbe1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

manimlib/config.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,13 @@ def get_output_directory(args: Namespace, config: Dict) -> str:
386386
out_dir = args.video_dir or dir_config.output
387387
if dir_config.mirror_module_path and args.file:
388388
file_path = Path(args.file).absolute()
389-
rel_path = file_path.relative_to(dir_config.removed_mirror_prefix)
390-
rel_path = Path(str(rel_path).lstrip("_"))
389+
print(file_path)
390+
print(dir_config.removed_mirror_prefix)
391+
if str(file_path).startswith(dir_config.removed_mirror_prefix):
392+
rel_path = file_path.relative_to(dir_config.removed_mirror_prefix)
393+
rel_path = Path(str(rel_path).lstrip("_"))
394+
else:
395+
rel_path = file_path.stem
391396
out_dir = Path(out_dir, rel_path).with_suffix("")
392397
return out_dir
393398

0 commit comments

Comments
 (0)