aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-05-26 21:18:27 +0200
committerKim Alvefur <zash@zash.se>2023-05-26 21:18:27 +0200
commit09a2018e4011c00a7a3a33befc1d61dc8c4a3c6c (patch)
tree40c3c0b367d8dfbc8e373823e4e3aebb995f8959 /util
parentd947a5273cbbc2ec1d18cc6b4b08b49a95f0e7ef (diff)
downloadprosody-09a2018e4011c00a7a3a33befc1d61dc8c4a3c6c.tar.gz
prosody-09a2018e4011c00a7a3a33befc1d61dc8c4a3c6c.zip
util.dependencies: Print tables itself to reduce number of imports
Rationale: See diffstat When this module is imported, it ends up calling stty via term_width() in util.human.io.table(). When this happens outside of a terminal, the following message is sent to stdout: stty: 'standard input': Inappropriate ioctl for device Not importing this module avoids that. Furthermore three is value in this module having minimal dependencies as they might not be available when it does the checks. Ref a1fed82c44b9
Diffstat (limited to 'util')
-rw-r--r--util/dependencies.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/dependencies.lua b/util/dependencies.lua
index 772ab130..30b53970 100644
--- a/util/dependencies.lua
+++ b/util/dependencies.lua
@@ -7,7 +7,6 @@
--
local function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else return nil, lib; end end
-local platform_table = require "prosody.util.human.io".table({ { width = 15, align = "right" }, { width = "100%" } });
-- Required to be able to find packages installed with luarocks
if not softreq "luarocks.loader" then -- LuaRocks 2.x
@@ -22,7 +21,7 @@ local function missingdep(name, sources, msg, err) -- luacheck: ignore err
print("This package can be obtained in the following ways:");
print("");
for _, row in ipairs(sources) do
- print(platform_table(row));
+ print(string.format("%15s | %s", table.unpack(row)));
end
print("");
print(msg or (name.." is required for Prosody to run, so we will now exit."));