def foreachDependency(self, command, recursive=False): if (self.config == None): return runCommand = command if (runCommand.startswith('!sh ')): runCommand = command[4:] i = runCommand.index(' ') task = Task(runCommand[:i]) runCommand = runCommand[i + 1:] else: task = Task('git') for p in self.config.sections(): d = GitDependenciesRepository(self.config[p]['url'], os.path.join(self.repositoryPath, p)) wd = os.getcwd() os.chdir(d.repositoryPath) task.run(runCommand.split(' ')) if (task.output != ''): print(task.output, file=sys.stderr) if (task.exitCode() != 0): sys.exit(task.exitCode()) os.chdir(wd) if (recursive): d.foreachDependency(command, True)
def foreachDependency(self, command, recursive = False): if (self.config == None): return runCommand = command if (runCommand.startswith('!sh ')): runCommand = command[4:] i = runCommand.index(' ') task = Task(runCommand[:i]) runCommand = runCommand[i + 1:] else: task = Task('git') for p in self.config.sections(): d = GitDependenciesRepository(self.config[p]['url'], os.path.join(self.repositoryPath, p)) wd = os.getcwd() os.chdir(d.repositoryPath) task.run(runCommand.split(' ')) if (task.output != ''): print(task.output, file=sys.stderr) if (task.exitCode() != 0): sys.exit(task.exitCode()) os.chdir(wd) if (recursive): d.foreachDependency(command, True)
def clone(self, branch=None): if (os.path.exists(self.repositoryPath)): return arguments = ['clone', '--recursive'] if (branch != None): arguments += ['--branch', branch] arguments += [self.remoteURL, self.repositoryPath] task = Task('git') task.run(arguments) if (task.exitCode() != 0): raise ValueError(task.output) self.__findGitRoot() self.__findGitDirectory()
def clone(self, branch = None): if (os.path.exists(self.repositoryPath)): return arguments = ['clone', '--recursive'] if (branch != None): arguments += ['--branch', branch] arguments += [self.remoteURL, self.repositoryPath] task = Task('git') task.run(arguments) if (task.exitCode() != 0): raise ValueError(task.output) self.__findGitRoot() self.__findGitDirectory()