]> khamidou — GitHub mirrors - liszt.git/commitdiff
polished liszt-setup
authorkhamidou <khamidou@gmail.com>
Thu, 18 Feb 2010 16:15:30 +0000 (17:15 +0100)
committerkhamidou <khamidou@gmail.com>
Thu, 18 Feb 2010 16:15:30 +0000 (17:15 +0100)
liszt-setup

index 9fc6046732b41156914b446a766e666269b6c813..2eed113aed3772d41e3261ba0dc11a6c056f791a 100755 (executable)
@@ -2,11 +2,20 @@
 # This program setups the ~/.liszt directory.
 
 import os
+import shutil
 import ConfigParser
 
 path = os.path.expanduser('~/.liszt/')
 
 if os.access(path, os.F_OK):
+    # Get rid of the previously created directory.
+    try:
+        shutil.rmtre(path)
+    except OSError:
+        print "Error : Unable to remove " + path
+        sys.exit(-1)
+
+    os.mkdir(path)
     os.chdir(path)
 else:
     os.mkdir(path)