* refactor(core)!: include all args in `Env.args_os`, closes #9430 * skip first arg on restart fn --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
@@ -0,0 +1,6 @@
+---
+"tauri": "patch:breaking"
+
+Include binary path in `Env.args_os`, previously it was skipped.
@@ -65,7 +65,7 @@ pub fn check(config: &Config, manifest: &mut Manifest) -> Result<()> {
if deps.is_empty() {
if let Some(alias) = &metadata.alias {
deps = find_dependency(manifest, alias, metadata.kind);
- name.clone_from(alias)
+ name.clone_from(alias);
}
@@ -295,7 +295,7 @@ pub struct Env {
#[allow(clippy::derivable_impls)]
impl Default for Env {
fn default() -> Self {
- let args_os = std::env::args_os().skip(1).collect();
+ let args_os = std::env::args_os().collect();
#[cfg(target_os = "linux")]
{
let env = Self {
@@ -76,7 +76,8 @@ pub fn restart(env: &Env) {
if let Ok(path) = current_binary(env) {
Command::new(path)
- .args(&env.args_os)
+ // first arg is the binary name, must skip it
+ .args(env.args_os.iter().skip(1).collect::<Vec<_>>())
.spawn()
.expect("application failed to start");