ubicloud/cli-commands/gh/post/remove-cache-entry.rb
Jeremy Evans 4d68fa2831 Add support for managing github installations/repositories/cache entries to the CLI
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.
2025-11-01 02:46:00 +09:00

15 lines
459 B
Ruby

# frozen_string_literal: true
UbiCli.on("gh").run_on("remove-cache-entry") do
desc "Remove cache entry for a GitHub repository"
banner "ubi gh installation-name/repository-name remove-cache-entry cache-entry-id"
args 1
run do |id, _, cmd|
check_no_slash(id, "invalid cache entry id format, should not include /", cmd)
@repository.remove_cache_entry(id)
response("Cache entry, if it exists, is now scheduled for destruction")
end
end