def _save(self): """Clowder save command private implementation :raise ClowderExit: """ if self.app.pargs.version.lower() == 'default': print(fmt.save_default_error(self.app.pargs.version)) raise ClowderExit(1) CLOWDER_REPO.print_status() validate_projects_exist(CLOWDER_CONTROLLER) validate_groups(CLOWDER_CONTROLLER.groups) version_name = self.app.pargs.version.replace( '/', '-') # Replace path separators with dashes version_dir = os.path.join(ROOT_DIR, '.clowder', 'versions', version_name) _make_dir(version_dir) yaml_file = os.path.join(version_dir, 'clowder.yaml') if os.path.exists(yaml_file): print( fmt.save_version_exists_error(version_name, yaml_file) + '\n') raise ClowderExit(1) print(fmt.save_version(version_name, yaml_file)) save_yaml(CLOWDER_CONTROLLER.get_yaml(), yaml_file)
def _init(self): """Clowder init command private implementation :raise ClowderExit: """ if os.path.isdir(CLOWDER_REPO.clowder_path): cprint('Clowder already initialized in this directory\n', 'red') raise ClowderExit(1) url_output = colored(self.app.pargs.url, 'green') print('Create clowder repo from ' + url_output + '\n') if self.app.pargs.branch is None: branch = 'master' else: branch = str(self.app.pargs.branch[0]) CLOWDER_REPO.init(self.app.pargs.url, branch)
def _commit(self): """Clowder repo commit command private implementation""" CLOWDER_REPO.commit(self.app.pargs.message[0])
def _add(self): """Clowder repo add command private implementation""" CLOWDER_REPO.add(self.app.pargs.files)
def _status(self): """Clowder repo status command private implementation""" CLOWDER_REPO.git_status()
def _clean(self): """Clowder repo clean command private implementation""" CLOWDER_REPO.clean()
def _checkout(self): """Clowder repo checkout command private implementation""" CLOWDER_REPO.checkout(self.app.pargs.ref[0])
def _run(self): """Clowder repo run command private implementation""" CLOWDER_REPO.run_command(self.app.pargs.command[0])
def _push(self): """Clowder repo push command private implementation""" CLOWDER_REPO.push()