mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 23:24:35 +01:00
Merge branch 'main' of https://github.com/Grasscutters/Cultivation
This commit is contained in:
@@ -209,6 +209,7 @@ fn main() -> Result<(), ArgsError> {
|
||||
get_theme_list,
|
||||
system_helpers::run_command,
|
||||
system_helpers::run_program,
|
||||
system_helpers::run_program_args,
|
||||
system_helpers::run_program_relative,
|
||||
system_helpers::start_service,
|
||||
system_helpers::service_status,
|
||||
|
||||
@@ -108,6 +108,18 @@ impl SpawnItsFineReally for Command {
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn run_program_args(path: String, args: Option<String>) {
|
||||
match open::with(
|
||||
format!("{}", args.unwrap_or_else(|| "".into())),
|
||||
path.clone(),
|
||||
) {
|
||||
Ok(_) => (),
|
||||
Err(e) => println!("Failed to open program ({}): {}", &path, e),
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn run_program(path: String, args: Option<String>) {
|
||||
// Without unwrap_or, this can crash when UAC prompt is denied
|
||||
|
||||
Reference in New Issue
Block a user