feat: appimage package script

revert: flutter lock file
This commit is contained in:
Kingtous committed 2022-06-09 17:46:17 +08:00
1 parent 0eeb0bacbd
commit 618be48726
10 files changed
+166 -171

No files matched your search

+12 -4
View File
@@ -377,10 +377,18 @@ pub fn get_time() -> i64 {
}
pub fn run_me<T: AsRef<std::ffi::OsStr>>(args: Vec<T>) -> std::io::Result<std::process::Child> {
let cmd = std::env::var("APPDIR").unwrap();
let p = Path::new(&cmd).join("AppRun");
log::info!("path: {:?}", p);
return std::process::Command::new(p).args(&args).spawn();
#[cfg(not(feature = "appimage"))]
{
let cmd = std::env::current_exe()?;
return std::process::Command::new(cmd).args(&args).spawn();
}
#[cfg(feature = "appimage")]
{
let appdir = std::env::var("APPDIR").unwrap();
let appimage_cmd = Path::new(&appdir).join("AppRun");
log::info!("path: {:?}", appimage_cmd);
return std::process::Command::new(appimage_cmd).args(&args).spawn();
}
}
pub fn username() -> String {