Bit of a hack to get shell escape working
This commit is contained in:
@@ -12,5 +12,4 @@ native-dialog = "0.6.3"
|
||||
rfd = "0.11.4"
|
||||
serde = "1.0.163"
|
||||
serde_derive = "1.0.163"
|
||||
shell-escape = "0.1.5"
|
||||
toml = "0.7.4"
|
||||
|
||||
16
src/main.rs
16
src/main.rs
@@ -137,9 +137,15 @@ impl RustDoomLauncher {
|
||||
fn form_command_string(&self) -> String {
|
||||
match self.get_launcher_and_command(false) {
|
||||
Ok((launch, comms)) => {
|
||||
//TODO - escape all the strings
|
||||
let c = comms.join(" ");
|
||||
format!("{} {}", launch, c)
|
||||
let mut command_string = String::new();
|
||||
// Feels like a bit of a hack, but it works I think
|
||||
command_string.push_str(&Cow::from(launch).to_string());
|
||||
for c in comms {
|
||||
command_string.push_str(" \'");
|
||||
command_string.push_str(c);
|
||||
command_string.push('\'')
|
||||
}
|
||||
command_string
|
||||
}
|
||||
Err(MyErrors::NoLauncher) => "Error: No launcher".to_string(),
|
||||
Err(MyErrors::NoIwad) => "Error: No IWAD".to_string(),
|
||||
@@ -364,7 +370,9 @@ impl eframe::App for RustDoomLauncher {
|
||||
ui.horizontal(|ui| {
|
||||
let mut text = self.form_command_string();
|
||||
let window_size = frame.info().window_info.size;
|
||||
ui.add(egui::TextEdit::multiline(&mut text).desired_width(window_size[0] * 0.9));
|
||||
ui.add(
|
||||
egui::TextEdit::multiline(&mut text).desired_width(window_size[0] * 0.9),
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user