Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions launch-patchwork/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
use std::io;
use std::process::Command;

fn await_confirmation() -> () {
println!("Press Enter to continue...");
let mut input = String::new();
std::io::stdin().read_line(&mut input).unwrap();
}

fn main() -> io::Result<()> {
// TODO: make this cross-platform
let godot = std::env::current_dir()?.join("./godot_editor/godot.windows.editor.x86_64.exe");

println!("Launching Godot from {:?}...", godot);

let status = Command::new(godot)
match Command::new(godot)
.arg("-e")
.arg("--path")
.arg(".")
.status()?;

if status.success() {
println!("Godot editor launched successfully.");
} else {
println!("Godot editor exited with: {}", status);
}
.status() {
Ok(status) if status.success() => {
println!("Godot editor launched successfully.");
}
Ok(status) => {
println!("Godot editor exited with: {}", status);
await_confirmation();
}
Err(e) => {
println!("Failed to launch Godot: {}", e);
await_confirmation();
}
}

Ok(())
}