55 lines
1.6 KiB
Rust
55 lines
1.6 KiB
Rust
//! Command implementations behind `main`: `up`, `preflight`, `status`, `down`, `profiles`.
|
|
use crate::{
|
|
cli::{Command, Environment, ReconfigureArgs, USAGE, UpOptions, parse},
|
|
plan::{Context, Mode, Step, StepState, UnitScopeTag, gather, plan_steps, render_plan},
|
|
preflight::Report,
|
|
profile::{BUILTIN, Profile},
|
|
steps::{self, gather_fs, say},
|
|
supervisor,
|
|
};
|
|
use serde_json::{Value, json};
|
|
use std::path::PathBuf;
|
|
|
|
/// Where `--persist` writes after a successful runtime change.
|
|
pub struct PersistTarget<'a> {
|
|
pub paths: &'a crate::layout::Paths,
|
|
pub settings: &'a serde_json::Map<String, Value>,
|
|
/// A supervisor runs: it records the change in the configuration it holds.
|
|
pub supervised: bool,
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod version_tests;
|
|
|
|
#[cfg(test)]
|
|
mod machine_tests;
|
|
|
|
#[cfg(test)]
|
|
mod status_tests;
|
|
|
|
mod entry;
|
|
mod install_flow;
|
|
mod machine_view;
|
|
mod preflight_report;
|
|
mod quick_health;
|
|
mod settings_change;
|
|
mod status_report;
|
|
mod stop_flow;
|
|
mod verify_flow;
|
|
pub use entry::{env_var, main_native, main_with, version_text};
|
|
pub use install_flow::{powershell_try, run_up, summary, summary_json, up};
|
|
pub use machine_view::render_machine;
|
|
#[cfg(unix)]
|
|
use preflight_report::seal_probe;
|
|
#[cfg(not(unix))]
|
|
use preflight_report::seal_probe;
|
|
use preflight_report::{json_plan, preflight, print_report};
|
|
use settings_change::reconfigure;
|
|
pub use settings_change::{render_effective, render_settings, send_reconfigure};
|
|
pub use status_report::{StatusReport, age_text, print_status, render_supervisor};
|
|
use status_report::{installed_scope, status, unix_now};
|
|
use stop_flow::down;
|
|
#[cfg(windows)]
|
|
pub use stop_flow::stop_foreground;
|
|
use verify_flow::verify;
|