Optimization to interface and improved installation process!

This commit is contained in:
usmannasir
2018-02-04 21:15:30 +05:00
parent 5946e860a5
commit 6cbc6e5e01
119 changed files with 85946 additions and 1993 deletions

View File

@@ -1181,12 +1181,23 @@ def installWordPress(domainName,finalPath,virtualHostUser,dbName,dbUser,dbPasswo
if not os.path.exists(finalPath):
os.makedirs(finalPath)
if not os.listdir(finalPath):
## checking for directories/files
dirFiles = os.listdir(finalPath)
if len(dirFiles) == 1:
if dirFiles[0] == ".well-known":
pass
else:
print "0,Target directory should be empty before installation, otherwise data loss could occur."
return
elif len(dirFiles) == 0:
pass
else:
print "0,Target directory should be empty before installation, otherwise data loss could occur."
return
## Get wordpress
@@ -1297,7 +1308,13 @@ def installJoomla(domainName,finalPath,virtualHostUser,dbName,dbUser,dbPassword,
if not os.path.exists(finalPath):
os.makedirs(finalPath)
if not os.listdir(finalPath):
if len(dirFiles) == 1:
if dirFiles[0] == ".well-known":
pass
else:
print "0,Target directory should be empty before installation, otherwise data loss could occur."
return
elif len(dirFiles) == 0:
pass
else:
print "0,Target directory should be empty before installation, otherwise data loss could occur."