def __init__(self, remote, path): # Require git on the system to have it sys.check_package('git') clean = re.sub('[.]git$', '', remote.split('/').pop()) self.local = fs.join(path, clean) self.remote = remote self.debug = False base = fs.dirname(self.local) if not fs.exists(base): fs.makedir(base) if not fs.exists(self.local): self.__clone__() else: self.__clean__() self.__rebase__()
def __clone__(self): self.__wrap__(fs.dirname(self.local), 'clone %s' % self.remote)