Skip to content

Commit

Permalink
fixed the exception test case
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongdai authored and insspb committed Jun 6, 2022
1 parent c7729fa commit 418e316
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cookiecutter/generate.py
Expand Up @@ -346,8 +346,10 @@ def generate_files(
outdir = env.from_string(outdir).render(**context)
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) and overwrite_if_exists:
# The outdir is not the root dir, it is the dir which marked as copy
# only in the config file. If the program hits this line, which means
# the overwrite_if_exists = True, and root dir exists
if os.path.isdir(outdir):
shutil.rmtree(outdir)
shutil.copytree(indir, outdir)

Expand Down

0 comments on commit 418e316

Please sign in to comment.