File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' tauri ' : ' major:breaking'
3+ ---
4+
5+ Changed ` Env.args ` to ` Env.args_os ` and now uses ` OsString ` instead of ` String `
Original file line number Diff line number Diff line change 1414#![ allow( clippy:: deprecated_semver) ]
1515
1616use std:: {
17+ ffi:: OsString ,
1718 fmt:: Display ,
1819 path:: { Path , PathBuf } ,
1920} ;
@@ -275,21 +276,21 @@ pub struct Env {
275276 #[ cfg( target_os = "linux" ) ]
276277 pub appdir : Option < std:: ffi:: OsString > ,
277278 /// The command line arguments of the current process.
278- pub args : Vec < String > ,
279+ pub args_os : Vec < OsString > ,
279280}
280281
281282#[ allow( clippy:: derivable_impls) ]
282283impl Default for Env {
283284 fn default ( ) -> Self {
284- let args = std:: env:: args ( ) . skip ( 1 ) . collect ( ) ;
285+ let args_os = std:: env:: args_os ( ) . skip ( 1 ) . collect ( ) ;
285286 #[ cfg( target_os = "linux" ) ]
286287 {
287288 let env = Self {
288289 #[ cfg( target_os = "linux" ) ]
289290 appimage : std:: env:: var_os ( "APPIMAGE" ) ,
290291 #[ cfg( target_os = "linux" ) ]
291292 appdir : std:: env:: var_os ( "APPDIR" ) ,
292- args ,
293+ args_os ,
293294 } ;
294295 if env. appimage . is_some ( ) || env. appdir . is_some ( ) {
295296 // validate that we're actually running on an AppImage
@@ -312,7 +313,7 @@ impl Default for Env {
312313 }
313314 #[ cfg( not( target_os = "linux" ) ) ]
314315 {
315- Self { args }
316+ Self { args_os }
316317 }
317318 }
318319}
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ pub fn restart(env: &Env) {
7676
7777 if let Ok ( path) = current_binary ( env) {
7878 Command :: new ( path)
79- . args ( & env. args )
79+ . args ( & env. args_os )
8080 . spawn ( )
8181 . expect ( "application failed to start" ) ;
8282 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ fn main() {
2121 match argv. nth ( 1 ) . as_deref ( ) {
2222 Some ( "restart" ) => {
2323 let mut env = Env :: default ( ) ;
24- env. args . clear ( ) ;
24+ env. args_os . clear ( ) ;
2525 tauri:: process:: restart ( & env)
2626 }
2727 Some ( invalid) => panic ! ( "only argument `restart` is allowed, {invalid} is invalid" ) ,
You can’t perform that action at this time.
0 commit comments