def init(self): """clowder init command""" if self.clowder_repo is None: url_output = colored(self.args.url, 'green') print('Create clowder repo from ' + url_output) print('') clowder_repo = ClowderRepo(self.root_directory) clowder_repo.init(self.args.url, self.args.branch) else: cprint('Clowder already initialized in this directory', 'red') print('') sys.exit()
def init(self): """clowder init command""" if self.clowder_repo: cprint('Clowder already initialized in this directory\n', 'red') sys.exit(1) if is_offline(): print(fmt.offline_error()) sys.exit(1) url_output = colored(self.args.url, 'green') print('Create clowder repo from ' + url_output + '\n') clowder_repo = ClowderRepo(self.root_directory) if self.args.branch is None: branch = 'master' else: branch = str(self.args.branch[0]) clowder_repo.init(self.args.url, branch)