pub mod archive;
pub mod cli;
pub mod commands;
pub mod config;
pub mod dispatch;
pub mod fs;
pub mod gvsn_release;
pub mod http;
pub mod lock;
pub mod profile;
pub mod prompt;
pub mod remote;
pub mod shell;
pub mod tempdir;
pub mod toolchain;
pub mod update_check;
pub mod user_version;
pub mod version;
use cli::Cli;
use config::Config;
use http::HttpClient;
pub fn run(cli: Cli) -> anyhow::Result<()> {
let config = Config::load()?;
let retries = match &cli.command {
cli::Command::Build { download, .. } => download.retries,
cli::Command::Install { download, .. } => download.retries,
cli::Command::Upgrade { download, .. } => download.retries,
_ => 3,
};
let client = HttpClient::new(cli.verbose, retries)?;
let (cmd_name, args) = dispatch::command_to_name_and_args(&cli.command);
dispatch::dispatch(
&config,
&config as &dyn config::ConfigMut,
&client,
cmd_name,
args,
)
}