def create_update_gitdir():
 if (not os.path.exists(gitdname)):
  retcode = subprocess.call(('git clone ' + repo), shell=True, stdout=sys.stdout, stderr=sys.stderr)
  if (retcode != 0):
   msg = 'There was a problem cloning the repo'
   raise Exception(msg)
 else:
  shutil.rmtree(gitdname)
  create_update_gitdir()

def create_update_gitdir ( ) : if ( not os . path . exists ( gitdname ) ) : retcode = subprocess . call ( ( 'git clone ' + repo ) , shell = True , stdout = sys . stdout , stderr = sys . stderr ) if ( retcode != 0 ) : msg = 'There was a problem cloning the repo' raise Exception ( msg ) else : shutil . rmtree ( gitdname ) create_update_gitdir ( )
creates a directory for local repo if it doesnt exist .