forked from lix-project/lix-installer
Tidy up plan / install UX
This commit is contained in:
parent
b123bbf285
commit
c22f92aee4
|
@ -29,7 +29,7 @@ pub struct Install {
|
||||||
pub plan: Option<PathBuf>,
|
pub plan: Option<PathBuf>,
|
||||||
|
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
pub planner: BuiltinPlanner,
|
pub planner: Option<BuiltinPlanner>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
|
@ -43,6 +43,13 @@ impl CommandExecute for Install {
|
||||||
explain,
|
explain,
|
||||||
} = self;
|
} = self;
|
||||||
|
|
||||||
|
let planner = match planner {
|
||||||
|
Some(planner) => planner,
|
||||||
|
None => BuiltinPlanner::default()
|
||||||
|
.await
|
||||||
|
.map_err(|e| eyre::eyre!(e))?,
|
||||||
|
};
|
||||||
|
|
||||||
let mut plan = match &plan {
|
let mut plan = match &plan {
|
||||||
Some(plan_path) => {
|
Some(plan_path) => {
|
||||||
let install_plan_string = tokio::fs::read_to_string(&plan_path)
|
let install_plan_string = tokio::fs::read_to_string(&plan_path)
|
||||||
|
|
|
@ -9,11 +9,10 @@ use crate::cli::CommandExecute;
|
||||||
|
|
||||||
/// Plan an install that can be repeated on an identical host later
|
/// Plan an install that can be repeated on an identical host later
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
#[command(args_conflicts_with_subcommands = true, arg_required_else_help = true)]
|
|
||||||
pub struct Plan {
|
pub struct Plan {
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
pub planner: Option<BuiltinPlanner>,
|
pub planner: Option<BuiltinPlanner>,
|
||||||
#[clap(env = "HARMONIC_PLAN")]
|
#[clap(env = "HARMONIC_PLAN", default_value = "/dev/stdout")]
|
||||||
pub output: PathBuf,
|
pub output: PathBuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue