Method: NexusCli::RepositoryActions#delete_repository

Defined in:
lib/nexus_cli/mixins/repository_actions.rb

#delete_repository(name) ⇒ Boolean

Deletes the given repository

into an id.

Parameters:

  • name (String)

    the name of the repositroy to delete, transformed

Returns:

  • (Boolean)

    true if the repository is deleted, false otherwise.



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nexus_cli/mixins/repository_actions.rb', line 40

def delete_repository(name)
  response = nexus.delete(nexus_url("service/local/repositories/#{sanitize_for_id(name)}"))
  case response.status
  when 204
    return true
  when 404
    raise RepositoryDoesNotExistException
  else
    raise UnexpectedStatusCodeException.new(response.status)
  end
end