new: add interactive wizard and remaining ecosystem templates

This commit is contained in:
2026-09-16 13:49:29 +02:00
parent d044f757e9
commit 9b98f5c7c3
17 changed files with 3930 additions and 99 deletions
+13 -5
View File
@@ -234,13 +234,14 @@ fn main() {
match matches.subcommand() {
Some(("new", sub_matches)) => {
// Without the interactive wizard (follow-up work), missing
// required answers produce one error listing all of them;
// --defaults fills everything else from the defaults.
let depends: Vec<String> = sub_matches
.get_many::<String>("depends")
.map(|values| values.cloned().collect())
.unwrap_or_default();
let no_verify = sub_matches
.get_one::<bool>("no_verify")
.copied()
.unwrap_or(false);
let cli = pkh::new::options::NewCli {
name: sub_matches.get_one::<String>("name").cloned(),
lang: sub_matches.get_one::<String>("lang").cloned(),
@@ -275,9 +276,16 @@ fn main() {
.unwrap_or(false),
};
// The wizard (interactive terminal) fills the same NewCli and
// resolves through the same pipeline; without a TTY the resolve
// error lists every missing answer. Afterwards the two
// verification builds are offered (`--no-verify` skips them;
// the structural self-checks inside `scaffold` always run).
if let Err(e) = rt.block_on(async {
let opts = pkh::new::options::resolve(cli).await?;
pkh::new::scaffold(opts, &multi)
let opts = pkh::new::questions::run(cli).await?;
pkh::new::scaffold(opts.clone(), &multi)?;
pkh::new::questions::offer_verification(&opts, &multi, no_verify).await;
Ok::<(), Box<dyn std::error::Error>>(())
}) {
error!("{}", e);
std::process::exit(1);