feat: pass through arguments
This commit is contained in:
@@ -6,8 +6,7 @@ use protostar::ProtoStar;
|
|||||||
use stardust_xr_molecules::fusion::client::Client;
|
use stardust_xr_molecules::fusion::client::Client;
|
||||||
use std::{
|
use std::{
|
||||||
env::{args, current_dir},
|
env::{args, current_dir},
|
||||||
path::{Path, PathBuf},
|
path::Path,
|
||||||
str::FromStr,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tokio::main(flavor = "current_thread")]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ use stardust_xr_molecules::{
|
|||||||
},
|
},
|
||||||
GrabData, Grabbable,
|
GrabData, Grabbable,
|
||||||
};
|
};
|
||||||
use std::{ffi::CString, path::PathBuf, sync::Arc};
|
use std::{env::args, ffi::CString, path::PathBuf, sync::Arc};
|
||||||
use tween::{QuartInOut, Tweener};
|
use tween::{QuartInOut, Tweener};
|
||||||
use ustr::ustr;
|
use ustr::ustr;
|
||||||
|
|
||||||
@@ -91,7 +91,12 @@ impl LifeCycleHandler for ProtoStar {
|
|||||||
std::env::set_var("STARDUST_STARTUP_TOKEN", future.await.unwrap());
|
std::env::set_var("STARDUST_STARTUP_TOKEN", future.await.unwrap());
|
||||||
if unsafe { fork() }.unwrap().is_parent() {
|
if unsafe { fork() }.unwrap().is_parent() {
|
||||||
let executable = ustr(executable.to_str().unwrap());
|
let executable = ustr(executable.to_str().unwrap());
|
||||||
execv::<CString>(executable.as_cstr(), &[]).unwrap();
|
let args = args()
|
||||||
|
.skip(1)
|
||||||
|
.map(|arg| CString::new(arg))
|
||||||
|
.collect::<Result<Vec<_>, _>>()
|
||||||
|
.unwrap();
|
||||||
|
execv::<CString>(executable.as_cstr(), args.as_slice()).unwrap();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user