mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-11-29 17:10:26 +08:00
This adds the following CLI commands: ``` ubi gh installation list ubi gh installation installation-name list-repositories ubi gh installation-name/repository-name list-cache-entries ubi gh installation-name/repository-name remove-cache-entry cache-entry-id ``` This adds Clover.humanize_size, so the list-cache-entries CLI command can reuse the logic.
16 lines
546 B
Ruby
16 lines
546 B
Ruby
# frozen_string_literal: true
|
|
|
|
UbiCli.on("gh").run_on("list-cache-entries") do
|
|
desc "List cache entries for a GitHub repository"
|
|
|
|
key = :cache_entries_list
|
|
|
|
options("ubi gh installation-name/repository-name list-cache-entries [options]", key:) do
|
|
on("-N", "--no-headers", "do not show headers")
|
|
end
|
|
|
|
run do |opts|
|
|
cache_entries = @repository.cache_entries.each { it.values[:size] = Clover.humanize_size(it[:size]) }
|
|
response(format_rows(%i[id size key], cache_entries, headers: opts[key][:"no-headers"] != false))
|
|
end
|
|
end
|