diff --git a/src/bin/rhai-repl.rs b/src/bin/rhai-repl.rs index af322021..62dc3869 100644 --- a/src/bin/rhai-repl.rs +++ b/src/bin/rhai-repl.rs @@ -78,7 +78,12 @@ fn main() { eprintln!("Error script file path: {}\n{}", filename, err); exit(1); } - Ok(f) => f, + Ok(f) => { + match f.strip_prefix(std::env::current_dir().unwrap().canonicalize().unwrap()) { + Ok(f) => f.into(), + _ => f, + } + } }; contents.clear(); diff --git a/src/bin/rhai-run.rs b/src/bin/rhai-run.rs index e2867515..4d1749df 100644 --- a/src/bin/rhai-run.rs +++ b/src/bin/rhai-run.rs @@ -43,7 +43,11 @@ fn main() { eprintln!("Error script file path: {}\n{}", filename, err); exit(1); } - Ok(f) => f, + Ok(f) => match f.strip_prefix(std::env::current_dir().unwrap().canonicalize().unwrap()) + { + Ok(f) => f.into(), + _ => f, + }, }; let mut engine = Engine::new();