Skip to content

Commit

Permalink
Fix use of shutil.copytree when overriding existing template files …
Browse files Browse the repository at this point in the history
…in `tmp_dir` (#2133)

* Fix use of shutil.copytree when overriding existing template files in tmp_dir

* [automated] Update CHANGELOG.md

---------

Co-authored-by: MultiQC Bot <multiqc-bot@seqera.io>
  • Loading branch information
vladsavelyev and multiqc-bot committed Oct 17, 2023
1 parent 82d65cb commit a191b0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Highlights:
- Just run CI on the oldest + newest supported Python versions ([#2074](https://github.com/ewels/MultiQC/pull/2074))
- <img src="./multiqc/templates/default/assets/img/favicon-16x16.png" alt="///" width="10px"/> New logo
- Set name and anchor for the custom content "module" [#2131](https://github.com/ewels/MultiQC/pull/2131)
- Fix use of `shutil.copytree` when overriding existing template files in `tmp_dir` ([#2133](https://github.com/ewels/MultiQC/pull/2133))

### New Modules

Expand Down
3 changes: 2 additions & 1 deletion multiqc/multiqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,10 @@ def __rich_measure__(self, console: rich.console.Console, options: rich.console.
# Load in parent template files first if a child theme
try:
parent_template = config.avail_templates[template_mod.template_parent].load()
shutil.copytree(parent_template.template_dir, tmp_dir)
except AttributeError:
pass # Not a child theme
else:
shutil.copytree(parent_template.template_dir, tmp_dir, dirs_exist_ok=True)

# Copy the template files to the tmp directory (`dirs_exist_ok` makes sure
# parent template files are overwritten)
Expand Down

0 comments on commit a191b0f

Please sign in to comment.