docs: def find_repo_by_name(name, repo_dir=None):
      """
      Searches the given repo name inside the repo_dir (will use the config value
      'template_repos' if no repo dir passed), will rise an exception if not
      found
  
      Args:
          name (str): Name of the repo to search
          repo_dir (str): Directory where to search the repo
  
      Return:
          str: path to the repo
  
      Raises:
          RuntimeError: if not found
      """
      if repo_dir is None:
          repo_dir = config.get('template_repos')
  
      ret, out, _ = utils.run_command([
          'find',
          repo_dir,
          '-name',
          '*.json',
      ], )
  
      repos = [
          TemplateRepository.from_url(line.strip()) for line in out.split('\n')
          if len(line.strip())
      ]
  
      for repo in repos:
          if repo.name == name:
              return repo
      raise RuntimeError('Could not find repo %s' % name)