Skip to content

Commit

Permalink
Minor cleanups to runscript Lua hook.
Browse files Browse the repository at this point in the history
- Use boolean, not integer for devnull.
- Expanded documentation.
  • Loading branch information
icculus committed Jun 16, 2010
1 parent 7c9ece8 commit 555738d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions docs.txt
Expand Up @@ -1092,10 +1092,14 @@ Your config file is a Lua script, and as such, has access to all of Lua's
runtime, as require() won't respect the Base Archive.


runScript (script, devnull, args...)

Run the given script in a shell. If devnull is non zero, all stdout
and stderr will be directed to /dev/null.
MojoSetup.runScript(script, devnull, args...)

Run the given script in a shell. If devnull is true, all stdout
and stderr will be suppressed (literally sent to /dev/null on Unix
systems). Please note that lots of things can be done through Lua,
directly in your config file, so you don't have to worry about the
unique quirks of various shells on end user systems. Still, there are
times when this is useful.


MojoSetup.translate(str)
Expand Down
2 changes: 1 addition & 1 deletion lua_glue.c
Expand Up @@ -1114,7 +1114,7 @@ static int luahook_platform_exec(lua_State *L)
static int luahook_platform_runscript(lua_State *L)
{
const char *script = luaL_checkstring(L, 1);
const boolean devnull = luaL_checkinteger(L, 2);
const boolean devnull = lua_toboolean(L, 2);
const int argc = lua_gettop(L);
const char *argv[11];
int i;
Expand Down

0 comments on commit 555738d

Please sign in to comment.