From 959921bf5fd56e3d3e66ef2dddf6ae51761bf54b Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 5 Oct 2020 21:35:15 +0100 Subject: [PATCH] Also allow forcing pull, even when no images found --- src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 99749ef..1aecf68 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,6 +18,9 @@ struct Opt { #[structopt(long)] force_cycle: bool, + + #[structopt(long)] + force_pull: bool, } fn get_files(files: &[String]) -> Option> { @@ -35,10 +38,10 @@ fn get_files(files: &[String]) -> Option> { Some(all_files) } -fn do_update(compose_project: compose::ComposeProject, force_cycle: bool) { +fn do_update(compose_project: compose::ComposeProject, force_cycle: bool, force_pull: bool) { info!("Processing {}...", compose_project); let pre_images = compose_project.get_images(); - if pre_images.is_empty() { + if pre_images.is_empty() && !force_pull { warn!("no running images, skipping"); return; } @@ -89,6 +92,6 @@ fn main() { info!("Found {} projects", compose_projects.len()); for compose_project in compose_projects { - do_update(compose_project, opts.force_cycle); + do_update(compose_project, opts.force_cycle, opts.force_pull); } }