From efa75cb17fd413f47e3eba4997bfd4c46494bffb Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Tue, 13 Jun 2023 11:09:18 -0400 Subject: Colorized error. --- src/lpm.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lpm.lua b/src/lpm.lua index 94c6c93..02e5c6f 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -481,6 +481,7 @@ end local Addon, Repository, LiteXL, Bottle = {}, {}, {}, {} local colors = { + red = 31, green = 32, yellow = 33, blue = 34, @@ -534,7 +535,7 @@ local function error_handler(err) io.stderr:write(json.encode({ error = message or err, actions = actions, warnings = warnings }) .. "\n") end else - if err then io.stderr:write((not VERBOSE and message or err) .. "\n") end + if err then io.stderr:write(colorize((not VERBOSE and message or err) .. "\n", "red")) end if VERBOSE then io.stderr:write(debug.traceback(nil, 2) .. "\n") end end status = -1 -- cgit v1.2.3