Browse Source

made os.spawn dump errors to stdout

XeonSquared 2 months ago
parent
commit
638092b4cc
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      module/loadfile.lua

+ 1
- 1
module/loadfile.lua View File

@@ -8,7 +8,7 @@ function runfile(p,...) -- runs file *p* with arbitrary arguments in the current
8 8
  return loadfile(p)(...)
9 9
 end
10 10
 function spawnfile(p,n) -- spawns a new process from file *p* with name *n*
11
- return os.spawn(loadfile(p),n)
11
+ return os.spawn(function() print(pcall(loadfile(p))) end,n)
12 12
 end
13 13
 function require(f) -- searches for a library with name *f* and returns what the library returns, if possible
14 14
  local lib = os.getenv("LIB") or "/boot/lib"

Loading…
Cancel
Save