@@ -28,7 +28,10 @@ def __init__(self, installApp, extraArgs):
2828 self .installApp = installApp
2929 self .extraArgs = extraArgs
3030 if extraArgs != None :
31- self .tempStatusPath = self .extraArgs ['tempStatusPath' ]
31+ try :
32+ self .tempStatusPath = self .extraArgs ['tempStatusPath' ]
33+ except :
34+ pass
3235
3336 def run (self ):
3437 try :
@@ -629,7 +632,12 @@ def setupGit(self):
629632
630633 try :
631634 command = 'git clone --depth 1 --no-single-branch git@' + defaultProvider + '.com:' + username + '/' + reponame + '.git -b ' + branch + ' ' + finalPath
632- ProcessUtilities .executioner (command , externalApp )
635+ output = ProcessUtilities .outputExecutioner (command , externalApp )
636+ if output .find ('Checking out files: 100%' ) == - 1 :
637+ statusFile = open (tempStatusPath , 'w' )
638+ statusFile .writelines ('%s. [404]' % (output ))
639+ statusFile .close ()
640+ return 0
633641 except subprocess .CalledProcessError as msg :
634642 statusFile = open (tempStatusPath , 'w' )
635643 statusFile .writelines (
@@ -684,15 +692,15 @@ def gitPull(self):
684692 logging .writeToFile ('Git is not setup for this website.' )
685693 return 0
686694
687- command = 'sudo git --git-dir=' + finalPath + '.git --work-tree=' + finalPath + ' pull'
695+ command = 'git --git-dir=' + finalPath + '.git --work-tree=' + finalPath + ' pull'
688696 ProcessUtilities .executioner (command , externalApp )
689697
690698 ##
691699
692700 website = Websites .objects .get (domain = domain )
693701 externalApp = website .externalApp
694702
695- command = "sudo chown -R " + externalApp + ":" + externalApp + " " + finalPath
703+ command = "chown -R " + externalApp + ":" + externalApp + " " + finalPath
696704 ProcessUtilities .executioner (command , externalApp )
697705
698706 return 0
@@ -723,15 +731,15 @@ def detachRepo(self):
723731 childDomain = ChildDomains .objects .get (domain = domain )
724732 finalPath = childDomain .path
725733
726- command = 'sudo rm -rf ' + finalPath
734+ command = 'rm -rf ' + finalPath
727735 ProcessUtilities .executioner (command , website .externalApp )
728736
729- command = 'sudo mkdir ' + finalPath
737+ command = 'mkdir ' + finalPath
730738 ProcessUtilities .executioner (command , website .externalApp )
731739
732740 ##
733741
734- command = "sudo chown -R " + externalApp + ":" + externalApp + " " + finalPath
742+ command = "chown -R " + externalApp + ":" + externalApp + " " + finalPath
735743 ProcessUtilities .executioner (command , website .externalApp )
736744
737745 gitPath = '/home/cyberpanel/' + domain + '.git'
0 commit comments