aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-10-19 14:56:02 +0200
committerGitHub <noreply@github.com>2022-10-19 14:56:02 +0200
commit9a2f83f46cf498b3532afb05213dcc54de8d243a (patch)
tree7572bb5a62a32dfbd10ba37cae6a8f462e61416e /lua/mason-core
parentfeat(api/command): add --debug flag to :MasonInstall (#576) (diff)
downloadmason-9a2f83f46cf498b3532afb05213dcc54de8d243a.tar
mason-9a2f83f46cf498b3532afb05213dcc54de8d243a.tar.gz
mason-9a2f83f46cf498b3532afb05213dcc54de8d243a.tar.bz2
mason-9a2f83f46cf498b3532afb05213dcc54de8d243a.tar.lz
mason-9a2f83f46cf498b3532afb05213dcc54de8d243a.tar.xz
mason-9a2f83f46cf498b3532afb05213dcc54de8d243a.tar.zst
mason-9a2f83f46cf498b3532afb05213dcc54de8d243a.zip
feat(installer): write mason-debug.log in debug mode (#577)
Diffstat (limited to 'lua/mason-core')
-rw-r--r--lua/mason-core/installer/init.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/mason-core/installer/init.lua b/lua/mason-core/installer/init.lua
index ba45789e..b5efa495 100644
--- a/lua/mason-core/installer/init.lua
+++ b/lua/mason-core/installer/init.lua
@@ -107,6 +107,14 @@ function M.execute(handle, opts)
local pkg = handle.package
local context = InstallContext.new(handle, opts)
+ if opts.debug then
+ local append_log = a.scope(function(chunk)
+ context.fs:append_file("mason-debug.log", chunk)
+ end)
+ handle:on("stdout", append_log)
+ handle:on("stderr", append_log)
+ end
+
log.fmt_info("Executing installer for %s", pkg)
return Result.run_catching(function()
-- 1. run installer