mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
fix: avoid duplicated flags
This commit is contained in:
@@ -442,7 +442,7 @@ fn dev_options(
|
||||
}
|
||||
*args = dev_args;
|
||||
|
||||
if mobile {
|
||||
if mobile && !args.contains(&"--lib".into()) {
|
||||
args.push("--lib".into());
|
||||
}
|
||||
|
||||
@@ -556,7 +556,9 @@ impl Rust {
|
||||
pub fn build_options(&self, args: &mut Vec<String>, features: &mut Vec<String>, mobile: bool) {
|
||||
features.push("tauri/custom-protocol".into());
|
||||
if mobile {
|
||||
args.push("--lib".into());
|
||||
if !args.contains(&"--lib".into()) {
|
||||
args.push("--lib".into());
|
||||
}
|
||||
} else {
|
||||
args.push("--bins".into());
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ pub fn run(options: Options, noise_level: NoiseLevel, dirs: &Dirs) -> Result<Bui
|
||||
&mut config,
|
||||
&mut env,
|
||||
noise_level,
|
||||
&dirs,
|
||||
dirs,
|
||||
)?;
|
||||
|
||||
if open {
|
||||
|
||||
@@ -306,7 +306,7 @@ fn run_dev(
|
||||
)?;
|
||||
}
|
||||
|
||||
crate::dev::setup(&interface, &mut dev_options, &mut tauri_config, &dirs)?;
|
||||
crate::dev::setup(&interface, &mut dev_options, &mut tauri_config, dirs)?;
|
||||
|
||||
let app_settings = interface.app_settings();
|
||||
let out_dir = app_settings.out_dir(
|
||||
@@ -369,7 +369,7 @@ fn run_dev(
|
||||
open_xcode()
|
||||
}
|
||||
},
|
||||
&dirs,
|
||||
dirs,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ impl Default for DevHost {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
|
||||
pub struct CliOptions {
|
||||
pub dev: bool,
|
||||
pub features: Vec<String>,
|
||||
@@ -177,20 +177,6 @@ pub struct CliOptions {
|
||||
pub target_device: Option<TargetDevice>,
|
||||
}
|
||||
|
||||
impl Default for CliOptions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
dev: false,
|
||||
features: Vec::new(),
|
||||
args: vec!["--lib".into()],
|
||||
noise_level: Default::default(),
|
||||
vars: Default::default(),
|
||||
config: Vec::new(),
|
||||
target_device: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn local_ip_address(force: bool) -> &'static IpAddr {
|
||||
static LOCAL_IP: OnceLock<IpAddr> = OnceLock::new();
|
||||
LOCAL_IP.get_or_init(|| {
|
||||
|
||||
Reference in New Issue
Block a user