Only print the Success! message if the command actually succeeded :-P

This commit is contained in:
Matt Westcott 2014-07-31 14:40:51 +01:00
parent 36e05307fe
commit 0f4191f7a9

View file

@ -44,14 +44,15 @@ def create_project(parser, options, args):
template_path = os.path.join(wagtail_path, 'project_template')
# Call django-admin startproject
subprocess.call([
result = subprocess.call([
'django-admin.py', 'startproject',
'--template=' + template_path,
'--name=Vagrantfile', '--ext=html,rst',
project_name
])
print("Success! %(project_name)s is created" % {'project_name': project_name})
if result == 0:
print("Success! %(project_name)s is created" % {'project_name': project_name})
COMMANDS = {