diff --git a/src/lib/globals/process.rs b/src/lib/globals/process.rs index 984eeae..4cffd26 100644 --- a/src/lib/globals/process.rs +++ b/src/lib/globals/process.rs @@ -119,6 +119,8 @@ fn process_env_iter<'lua>(lua: &'lua Lua, (_, _): (Value<'lua>, ())) -> Result) -> Result<()> { + // TODO: Exit gracefully to the root with an Ok + // result instead of completely exiting the process if let Some(code) = exit_code { exit(code); } else { diff --git a/src/lib/lib.rs b/src/lib/lib.rs index cd88d0c..773ea16 100644 --- a/src/lib/lib.rs +++ b/src/lib/lib.rs @@ -98,6 +98,7 @@ mod tests { fs_dirs: "fs/dirs", process_args: "process/args", process_env: "process/env", + process_exit: "process/exit", process_spawn: "process/spawn", net_request_codes: "net/request/codes", net_request_methods: "net/request/methods", diff --git a/src/tests/process/exit.luau b/src/tests/process/exit.luau new file mode 100644 index 0000000..f55d04e --- /dev/null +++ b/src/tests/process/exit.luau @@ -0,0 +1,3 @@ +process.exit(0) + +error("Process should have exited successfully")