Function xplr::lua::util::shell_execute
source · pub fn shell_execute<'a>(util: Table<'a>, lua: &Lua) -> Result<Table<'a>>
Expand description
Execute shell commands safely.
Type: function( program:string, args:{ string, … }|nil ) -> { stdout = string, stderr = string, returncode = number|nil }
Example:
xplr.util.shell_execute("pwd")
-- { stdout = "/present/working/directory", stderr = "", returncode = 0 }
xplr.util.shell_execute("bash", {"-c", "xplr --help"})
-- { stdout = "xplr...", stderr = "", returncode = 0 }