|
@@ -12,6 +12,7 @@ use cargo_mobile::{
|
|
config::Config,
|
|
config::Config,
|
|
device::PromptError,
|
|
device::PromptError,
|
|
env::{Env, Error as EnvError},
|
|
env::{Env, Error as EnvError},
|
|
|
|
+ opts::NoiseLevel,
|
|
os, util,
|
|
os, util,
|
|
util::prompt,
|
|
util::prompt,
|
|
};
|
|
};
|
|
@@ -92,7 +93,7 @@ enum Commands {
|
|
}
|
|
}
|
|
|
|
|
|
pub fn command(cli: Cli, verbosity: usize) -> Result<()> {
|
|
pub fn command(cli: Cli, verbosity: usize) -> Result<()> {
|
|
- let noise_level = super::verbosity_to_noise_level(verbosity);
|
|
|
|
|
|
+ let noise_level = NoiseLevel::from_occurrences(verbosity as u64);
|
|
match cli.command {
|
|
match cli.command {
|
|
Commands::Init(options) => init_command(options, MobileTarget::Ios)?,
|
|
Commands::Init(options) => init_command(options, MobileTarget::Ios)?,
|
|
Commands::Open => open::command()?,
|
|
Commands::Open => open::command()?,
|
|
@@ -106,19 +107,18 @@ pub fn command(cli: Cli, verbosity: usize) -> Result<()> {
|
|
|
|
|
|
fn with_config<T>(
|
|
fn with_config<T>(
|
|
cli_options: Option<CliOptions>,
|
|
cli_options: Option<CliOptions>,
|
|
- f: impl FnOnce(&Config, &AppleConfig, &AppleMetadata) -> Result<T, Error>,
|
|
|
|
|
|
+ f: impl FnOnce(&Config, &AppleConfig, &AppleMetadata, CliOptions) -> Result<T, Error>,
|
|
) -> Result<T, Error> {
|
|
) -> Result<T, Error> {
|
|
- let (config, metadata) = {
|
|
|
|
|
|
+ let (config, metadata, cli_options) = {
|
|
let tauri_config =
|
|
let tauri_config =
|
|
get_tauri_config(None).map_err(|e| Error::InvalidTauriConfig(e.to_string()))?;
|
|
get_tauri_config(None).map_err(|e| Error::InvalidTauriConfig(e.to_string()))?;
|
|
let tauri_config_guard = tauri_config.lock().unwrap();
|
|
let tauri_config_guard = tauri_config.lock().unwrap();
|
|
let tauri_config_ = tauri_config_guard.as_ref().unwrap();
|
|
let tauri_config_ = tauri_config_guard.as_ref().unwrap();
|
|
- get_config(
|
|
|
|
- tauri_config_,
|
|
|
|
- cli_options.unwrap_or_else(|| read_options(tauri_config_, MobileTarget::Ios)),
|
|
|
|
- )
|
|
|
|
|
|
+ let cli_options = cli_options.unwrap_or_else(|| read_options(tauri_config_, MobileTarget::Ios));
|
|
|
|
+ let (config, metadata) = get_config(tauri_config_, &cli_options);
|
|
|
|
+ (config, metadata, cli_options)
|
|
};
|
|
};
|
|
- f(&config, config.apple(), metadata.apple())
|
|
|
|
|
|
+ f(&config, config.apple(), metadata.apple(), cli_options)
|
|
}
|
|
}
|
|
|
|
|
|
fn device_prompt<'a>(env: &'_ Env) -> Result<Device<'a>, PromptError<ios_deploy::DeviceListError>> {
|
|
fn device_prompt<'a>(env: &'_ Env) -> Result<Device<'a>, PromptError<ios_deploy::DeviceListError>> {
|