Garbage collect old releases

This commit is contained in:
Michael Vines
2021-01-29 15:38:54 -08:00
committed by mergify[bot]
parent 9e3c130ac9
commit ea4f516f84
3 changed files with 71 additions and 1 deletions

View File

@@ -208,6 +208,11 @@ pub fn main() -> Result<(), String> {
.help("Keypair file for the update manifest (/path/to/keypair.json)"),
),
)
.subcommand(
SubCommand::with_name("gc")
.about("Delete older releases from the install cache to reclaim disk space")
.setting(AppSettings::DisableVersion),
)
.subcommand(
SubCommand::with_name("update")
.about("Checks for an update, and if available downloads and applies it")
@@ -255,6 +260,7 @@ pub fn main() -> Result<(), String> {
update_manifest_keypair_file,
)
}
("gc", Some(_matches)) => command::gc(config_file),
("update", Some(_matches)) => command::update(config_file).map(|_| ()),
("run", Some(matches)) => {
let program_name = matches.value_of("program_name").unwrap();