From 09a6ad3ae2bc45c6754f17e5dc8d93fbbc435e56 Mon Sep 17 00:00:00 2001 From: rhpidfyre Date: Tue, 14 Jan 2025 16:17:12 -0500 Subject: [PATCH] history tweaks --- src/commands.rs | 2 +- src/history.rs | 5 ++--- src/vm/shell.rs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index e766125..67cb193 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -98,7 +98,7 @@ impl Command { history.add(self.0.as_str()); child.wait().ok(); } else { - println!("Unknown command: {}", self.0) + println!("lambdashell: Unknown command: {}", self.0) } } diff --git a/src/history.rs b/src/history.rs index fd9069d..2065c23 100644 --- a/src/history.rs +++ b/src/history.rs @@ -36,9 +36,8 @@ impl History { .open(history_file.as_path()) .map_or_display(|mut file| { let newline_maybe = if fs_history.is_empty() { "" } else { "\n" }; - if let Err(write_err) = file.write_all(format!("{newline_maybe}{}", self.history.join("\n")).as_bytes()) { - session::shell_error(write_err); - }; + let formatted = format!("{newline_maybe}{}", self.history.join("\n")); + file.write_all(formatted.as_bytes()).unwrap_or_else(session::shell_error) }); } } diff --git a/src/vm/shell.rs b/src/vm/shell.rs index b403cf0..c532d17 100644 --- a/src/vm/shell.rs +++ b/src/vm/shell.rs @@ -41,7 +41,7 @@ pub trait ShellGlobal { } impl ShellGlobal for LuauVm { fn global_shell(&self, luau_globals: &Table) -> lResult<()> { - luau_globals.set("SHELL", Shell(Rc::clone(&self.ps)))?; + luau_globals.raw_set("SHELL", Shell(Rc::clone(&self.ps)))?; Ok(()) } } \ No newline at end of file