Repository: cookiecutter/cookiecutter

Issue:
Allow for copy_without_render to render output directory name
I find it strange that copy_without_render doesn't render the directory name.

An example use case is wanting to copy a templates directory in your project that contains jinja, the directory is copied however it is placed into a folder like '{{cookiecutter.repo_name}}/templates' as opposed to 'someproject/templates'

I understand some people may in fact want this, but maybe an option to to toggle this behavior would welcome. 



Discussion:
:+1: 


Resolving patch:
diff --git a/cookiecutter/generate.py b/cookiecutter/generate.py
--- a/cookiecutter/generate.py
+++ b/cookiecutter/generate.py
@@ -323,6 +323,7 @@ def generate_files(
             for copy_dir in copy_dirs:
                 indir = os.path.normpath(os.path.join(root, copy_dir))
                 outdir = os.path.normpath(os.path.join(project_dir, indir))
+                outdir = env.from_string(outdir).render(**context)
                 logger.debug('Copying dir %s to %s without rendering', indir, outdir)
                 shutil.copytree(indir, outdir)
 


Test patch:
diff --git a/tests/test-generate-copy-without-render/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}-rendered/README.md b/tests/test-generate-copy-without-render/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}-rendered/README.md
new file mode 100644
--- /dev/null
+++ b/tests/test-generate-copy-without-render/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}-rendered/README.md
@@ -0,0 +1,3 @@
+# Fake Project
+
+{{cookiecutter.render_test}}
diff --git a/tests/test_generate_copy_without_render.py b/tests/test_generate_copy_without_render.py
--- a/tests/test_generate_copy_without_render.py
+++ b/tests/test_generate_copy_without_render.py
@@ -31,6 +31,7 @@ def test_generate_copy_without_render_extensions():
                     '*not-rendered',
                     'rendered/not_rendered.yml',
                     '*.txt',
+                    '{{cookiecutter.repo_name}}-rendered/README.md',
                 ],
             }
         },
@@ -39,7 +40,7 @@ def test_generate_copy_without_render_extensions():
 
     dir_contents = os.listdir('test_copy_without_render')
 
-    assert '{{cookiecutter.repo_name}}-not-rendered' in dir_contents
+    assert 'test_copy_without_render-not-rendered' in dir_contents
     assert 'test_copy_without_render-rendered' in dir_contents
 
     with open('test_copy_without_render/README.txt') as f:
@@ -59,9 +60,16 @@ def test_generate_copy_without_render_extensions():
         assert 'I have been rendered' in f.read()
 
     with open(
-        'test_copy_without_render/{{cookiecutter.repo_name}}-not-rendered/README.rst'
+        'test_copy_without_render/'
+        'test_copy_without_render-not-rendered/'
+        'README.rst'
     ) as f:
         assert '{{cookiecutter.render_test}}' in f.read()
 
     with open('test_copy_without_render/rendered/not_rendered.yml') as f:
         assert '{{cookiecutter.render_test}}' in f.read()
+
+    with open(
+        'test_copy_without_render/' 'test_copy_without_render-rendered/' 'README.md'
+    ) as f:
+        assert '{{cookiecutter.render_test}}' in f.read()