Permalink
Browse files

Instead of bailing on bad name input, re-prompt for new name

  • Loading branch information...
1 parent cc3dcfd commit 251f23bed4211d21fc52f5989ddbb4f466126038 @evansolomon committed Aug 19, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −7 _sh
View
13 _sh
@@ -4,7 +4,6 @@
import urllib
import urllib2
import shutil
-import sys
import zipfile
import os
@@ -17,14 +16,14 @@ print "Let's get started.\n"
name = raw_input('Name? ')
# You need to provide at least a name
-if not name:
- print "\nYou need a name for your theme.\n\nExiting..."
- sys.exit()
+while not name:
+ print "\nYou need a name for your theme.\n\n"
+ name = raw_input('Name? ')
# ... and it needs to be unique
-if os.path.exists(name) or os.path.exists(name + '.zip'):
- print "\nYou should pick a name that isn't already used for a file or directory.\n\nExiting..."
- sys.exit()
+while os.path.exists(name) or os.path.exists(name + '.zip'):
+ print "\nYou should pick a name that isn't already used for a file or directory.\n\n"
+ name = raw_input('Name? ')
# Get the rest of your customizations
slug = raw_input('Slug? ')

0 comments on commit 251f23b

Please sign in to comment.