From ad9d1bef4abdf64a447964a5018cb01fd640f3b0 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 28 Dec 2017 18:33:36 +1100 Subject: src/loslib.js: fix os.execute(nil) case --- src/loslib.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/loslib.js b/src/loslib.js index f27a7ed..83da409 100644 --- a/src/loslib.js +++ b/src/loslib.js @@ -257,18 +257,11 @@ if (typeof process === "undefined") { return lauxlib.luaL_execresult(L, null); } else { - try { - child_process.execSync( - Uint8Array.from(cmd), - { - stdio: [process.stdin, process.stdout, process.stderr] - } - ); - lua.lua_pushboolean(L, 1); - } catch (e) { - lua.lua_pushboolean(L, 0); - } - + /* Assume a shell is available. + If it's good enough for musl it's good enough for us. + http://git.musl-libc.org/cgit/musl/tree/src/process/system.c?id=ac45692a53a1b8d2ede329d91652d43c1fb5dc8d#n22 + */ + lua.lua_pushboolean(L, 1); return 1; } }; -- cgit v1.2.3-70-g09d2