Skip to content

Commit

Permalink
Fix globals being injected multiple times in repl
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Mar 12, 2024
1 parent 9f58414 commit 0116d40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lune/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ impl Runtime {
lua.set_app_data(Rc::downgrade(&lua));
lua.set_app_data(Vec::<String>::new());

globals::inject_all(&lua).expect("Failed to inject globals");

Self {
lua,
args: Vec::new(),
Expand Down Expand Up @@ -65,7 +67,6 @@ impl Runtime {
) -> Result<ExitCode, RuntimeError> {
// Create a new scheduler for this run
let sched = Scheduler::new(&self.lua);
globals::inject_all(&self.lua)?;

// Add error callback to format errors nicely + store status
let got_any_error = Arc::new(AtomicBool::new(false));
Expand Down

0 comments on commit 0116d40

Please sign in to comment.