Comparison

util/prosodyctl.lua @ 12785:123d74bf60e3

util.prosodyctl: Remove Lua 5.1 os.execute() return value compat
author Kim Alvefur <zash@zash.se>
date Thu, 20 Oct 2022 17:37:07 +0200
parent 11490:34d4e4a01ef8
child 12975:d10957394a3c
comparison
equal deleted inserted replaced
12784:3b9de8dd71a3 12785:123d74bf60e3
222 local function call_luarocks(operation, mod, server) 222 local function call_luarocks(operation, mod, server)
223 local dir = prosody.paths.installer; 223 local dir = prosody.paths.installer;
224 local ok, _, code = os.execute(render_cli("luarocks --lua-version={luav} {op} --tree={dir} {server&--server={server}} {mod?}", { 224 local ok, _, code = os.execute(render_cli("luarocks --lua-version={luav} {op} --tree={dir} {server&--server={server}} {mod?}", {
225 dir = dir; op = operation; mod = mod; server = server; luav = _VERSION:match("5%.%d"); 225 dir = dir; op = operation; mod = mod; server = server; luav = _VERSION:match("5%.%d");
226 })); 226 }));
227 if type(ok) == "number" then code = ok; end 227 return ok and code;
228 return code;
229 end 228 end
230 229
231 return { 230 return {
232 show_message = show_message; 231 show_message = show_message;
233 show_warning = show_message; 232 show_warning = show_message;