From bf360f5fa6912f4ac684cfa642701be626396798 Mon Sep 17 00:00:00 2001 From: tknickman Date: Fri, 12 May 2023 15:51:45 -0400 Subject: [PATCH] fix(cli): example should imply copy --- crates/turborepo-lib/src/commands/generate.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/turborepo-lib/src/commands/generate.rs b/crates/turborepo-lib/src/commands/generate.rs index 2603a74fd5fea..88d4313ce4606 100644 --- a/crates/turborepo-lib/src/commands/generate.rs +++ b/crates/turborepo-lib/src/commands/generate.rs @@ -40,8 +40,15 @@ pub fn run(command: &GenerateCommand, tag: &String) -> Result<()> { match command { GenerateCommand::Add(args) => { + let mut add_args = args.clone(); + // example implies copy + if add_args.example.is_some() { + add_args.copy = true; + add_args.empty = false; + } + // convert args to json - let raw_args = serde_json::to_string(args)?; + let raw_args = serde_json::to_string(&add_args)?; call_turbo_gen("add", tag, &raw_args)?; } GenerateCommand::Custom(args) => {