Skip to content

Commit 2540490

Browse files
committed
bug fix: create wp staging
1 parent c397ba1 commit 2540490

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

websiteFunctions/StagingSetup.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/local/CyberCP/bin/python
2+
import subprocess
23
import threading as multi
34
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
45
from plogical.virtualHostUtilities import virtualHostUtilities
@@ -51,6 +52,21 @@ def startCloning(self):
5152
masterPath = '/home/%s/public_html' % (masterDomain)
5253
replaceDomain = masterDomain
5354

55+
### Check WP CLI
56+
57+
try:
58+
command = 'wp --info'
59+
outout = ProcessUtilities.outputExecutioner(command)
60+
61+
if not outout.find('WP-CLI root dir:') > -1:
62+
from plogical.applicationInstaller import ApplicationInstaller
63+
ai = ApplicationInstaller(None, None)
64+
ai.installWPCLI()
65+
except subprocess.CalledProcessError:
66+
from plogical.applicationInstaller import ApplicationInstaller
67+
ai = ApplicationInstaller(None, None)
68+
ai.installWPCLI()
69+
5470
configPath = '%s/wp-config.php' % (masterPath)
5571

5672
## Check if WP Detected on Main Site

0 commit comments

Comments
 (0)