FEAT: Launch with custom config location

FEAT: Generate banner
FEAT: Start blender with banner
This commit is contained in:
valerio
2026-03-10 22:14:27 +01:00
parent 132b1ccee7
commit b9b6bd1490
11 changed files with 224 additions and 30 deletions
+15 -3
View File
@@ -1,5 +1,6 @@
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
use std::collections::HashMap;
use std::fs::File;
use std::path::Path;
@@ -50,13 +51,24 @@ fn strip_single_top_level_directory(target_dir: &Path) -> Result<bool, std::io::
}
#[tauri::command]
fn launch_binary(path: String, args: Vec<String>) -> Result<String, String> {
fn launch_binary(
path: String,
args: Vec<String>,
env: Option<HashMap<String, String>>,
) -> Result<String, String> {
use std::process::{Command, Stdio};
Command::new(path)
let mut command = Command::new(path);
command
.args(args)
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null())
.stderr(Stdio::null());
if let Some(env_vars) = env {
command.envs(env_vars);
}
command
.spawn()
.map(|_| "Launched".into())
.map_err(|e| e.to_string())