From 638092b4cc0889eea4924cb52e74a70d900ecbb1 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Wed, 9 Jan 2019 16:17:41 +1100 Subject: [PATCH] made os.spawn dump errors to stdout --- module/loadfile.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/loadfile.lua b/module/loadfile.lua index 5b24783..875712e 100644 --- a/module/loadfile.lua +++ b/module/loadfile.lua @@ -8,7 +8,7 @@ function runfile(p,...) -- runs file *p* with arbitrary arguments in the current return loadfile(p)(...) end function spawnfile(p,n) -- spawns a new process from file *p* with name *n* - return os.spawn(loadfile(p),n) + return os.spawn(function() print(pcall(loadfile(p))) end,n) end function require(f) -- searches for a library with name *f* and returns what the library returns, if possible local lib = os.getenv("LIB") or "/boot/lib"