mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-28 06:54:13 -04:00
Improved behavior when tmp directory exists
This commit is contained in:
parent
c0a9ebe548
commit
c366945d89
1 changed files with 4 additions and 10 deletions
|
@ -31,18 +31,12 @@ class DirectoryController(object):
|
||||||
os.mkdir(full_path)
|
os.mkdir(full_path)
|
||||||
|
|
||||||
def create_base_directories(self):
|
def create_base_directories(self):
|
||||||
#first create the directory for the development environment to be installed in
|
|
||||||
try:
|
try:
|
||||||
#os.mkdir(self.root_install_directory)
|
if os.path.exists(self.tmp_directory):
|
||||||
#then the tmp directory for file downloads and the like
|
shutil.rmtree(self.tmp_directory)
|
||||||
os.mkdir(self.tmp_directory)
|
os.mkdir(self.tmp_directory)
|
||||||
#then the bin directory for binaries(also includes binaries for dependencies?
|
|
||||||
#os.mkdir(self.bin_directory)
|
|
||||||
except:
|
except:
|
||||||
#cleanup whatever we created
|
raise errors.CoCoError(u"There was an error creating the directory structure, do you have correct permissions? Please remove all and start over.")
|
||||||
#self.remove_directories()
|
|
||||||
raise errors.CoCoError(u"There was an error creating the directory structure, do you have correct permissions? Please remove all and start over.")
|
|
||||||
|
|
||||||
|
|
||||||
def remove_directories(self):
|
def remove_directories(self):
|
||||||
print u"Removed directories created!"
|
print u"Removed directories created!"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue