From e8e5f4eef5ada7a7f42bc12c22a0713d45a4b62f Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Mon, 29 May 2023 16:24:44 -0700 Subject: [PATCH] Adjust demo to be runnable in workspace --- demo/src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/demo/src/main.rs b/demo/src/main.rs index adcdf16..aab5f51 100644 --- a/demo/src/main.rs +++ b/demo/src/main.rs @@ -1,3 +1,13 @@ -fn main() { - renrs_gui::run("demo.rpy".into()); +use std::env; + +fn main() -> Result<(), std::io::Error> { + let mut path = env::current_exe()?; // /target/debug/renrs-demo + path.pop(); // /target/debug + path.pop(); // /target + path.pop(); // / + path.push("demo/demo.rpy"); // /demo/demo.rpy + + renrs_gui::run(path); + + Ok(()) }