Fix bug about inexistent directories
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Sat, 25 Apr 2009 07:20:11 +0000 (07:20 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Sat, 25 Apr 2009 07:20:11 +0000 (07:20 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2667 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py

index 00b687d788c5510b97b830bfdf6e022faf990e8f..ec52a21050acd81b7d341fd2ba8f69c069724b49 100644 (file)
@@ -55,8 +55,9 @@ def bertosVersion(directory):
 def createBertosProject(project_info):
     directory = project_info.info("PROJECT_PATH")
     sources_dir = project_info.info("SOURCES_PATH")
-    if not os.path.isdir(directory):
-        os.mkdir(directory)
+    if os.path.isdir(directory):
+        shutil.rmtree(directory, True)        
+    os.makedirs(directory)
     f = open(directory + "/project.bertos", "w")
     f.write(pickle.dumps(project_info))
     f.close()