From dd1b7fd9aa72d6f1272b4691b2bd7d85c2550365 Mon Sep 17 00:00:00 2001 From: "Dotan J. Nahum" Date: Thu, 14 Nov 2024 05:27:20 +0200 Subject: [PATCH] migrate gen to loco-new --- loco-gen/src/model.rs | 1 + loco-new/src/wizard.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/loco-gen/src/model.rs b/loco-gen/src/model.rs index 7d04494a..0e1a7404 100644 --- a/loco-gen/src/model.rs +++ b/loco-gen/src/model.rs @@ -120,6 +120,7 @@ mod tests { "async", "--assets", "serverside", + "-a", ]) .status() .expect("cannot run command"); diff --git a/loco-new/src/wizard.rs b/loco-new/src/wizard.rs index 7aecc5c7..d7dd912a 100644 --- a/loco-new/src/wizard.rs +++ b/loco-new/src/wizard.rs @@ -294,6 +294,15 @@ where /// # Errors /// when could not show user selection or user chose not continue pub fn start(args: &ArgsPlaceholder) -> crate::Result { + // user provided everything via flags so no need to prompt, just return + if args.db.is_some() && args.bg.is_some() && args.assets.is_some() { + return Ok(Selections { + db: args.db.clone().unwrap(), + background: args.bg.clone().unwrap(), + asset: args.assets.clone().unwrap(), + }); + } + let template = select_option( "❯ What would you like to build?", &Template::iter().collect::>(),