Skip to content

Commit

Permalink
add extra check for the overwrite_if_exists flag
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Tribone <780132+att14@users.noreply.github.com>
  • Loading branch information
2 people authored and insspb committed Jun 6, 2022
1 parent cf3c85b commit 855a1c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cookiecutter/generate.py
Expand Up @@ -345,7 +345,7 @@ def generate_files(
logger.debug('Copying dir %s to %s without rendering', indir, outdir)

# if the outdir is there, it must be a overwrite execution
if os.path.isdir(outdir):
if os.path.isdir(outdir) and overwrite_if_exists:
shutil.rmtree(outdir)
shutil.copytree(indir, outdir)

Expand Down

0 comments on commit 855a1c3

Please sign in to comment.