1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #17503 -- A destination directory passed to startproject or startapp as optional second argument is now reused as the project/app directory, rather than a new project/app directory created within it. Refs #17042.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Carl Meyer
2012-01-04 23:55:34 +00:00
parent 8e9043bccb
commit bc63ba700a
3 changed files with 32 additions and 20 deletions

View File

@@ -73,15 +73,14 @@ class TemplateCommand(BaseCommand):
# if some directory is given, make sure it's nicely expanded
if target is None:
target = os.getcwd()
top_dir = path.join(os.getcwd(), name)
try:
os.makedirs(top_dir)
except OSError, e:
raise CommandError(e)
else:
target = path.expanduser(target)
top_dir = path.expanduser(target)
top_dir = path.join(target, name)
try:
os.makedirs(top_dir)
except OSError, e:
raise CommandError(e)
extensions = tuple(
handle_extensions(options.get('extensions'), ignored=()))