diff options
| author | William Boman <william@redwill.se> | 2023-10-13 01:27:58 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2025-02-19 09:23:19 +0100 |
| commit | c338fb2698ae276bc3b6edccdd3afaef92fc77bd (patch) | |
| tree | ab9ec90f23e5ba1c48585fd41ef987cff8c3a693 /lua/mason-core/installer/runner.lua | |
| parent | refactor: add InstallLocation.global() (diff) | |
| download | mason-c338fb2698ae276bc3b6edccdd3afaef92fc77bd.tar mason-c338fb2698ae276bc3b6edccdd3afaef92fc77bd.tar.gz mason-c338fb2698ae276bc3b6edccdd3afaef92fc77bd.tar.bz2 mason-c338fb2698ae276bc3b6edccdd3afaef92fc77bd.tar.lz mason-c338fb2698ae276bc3b6edccdd3afaef92fc77bd.tar.xz mason-c338fb2698ae276bc3b6edccdd3afaef92fc77bd.tar.zst mason-c338fb2698ae276bc3b6edccdd3afaef92fc77bd.zip | |
refactor(installer): move initializations to InstallContext constructor
Diffstat (limited to 'lua/mason-core/installer/runner.lua')
| -rw-r--r-- | lua/mason-core/installer/runner.lua | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lua/mason-core/installer/runner.lua b/lua/mason-core/installer/runner.lua index 175610d5..8a03b724 100644 --- a/lua/mason-core/installer/runner.lua +++ b/lua/mason-core/installer/runner.lua @@ -8,9 +8,6 @@ local log = require "mason-core.log" local registry = require "mason-registry" local InstallContext = require "mason-core.installer.context" -local InstallContextCwd = require "mason-core.installer.context.cwd" -local InstallContextFs = require "mason-core.installer.context.fs" -local InstallContextSpawn = require "mason-core.installer.context.spawn" ---@class InstallRunner ---@field location InstallLocation @@ -37,10 +34,7 @@ function InstallRunner:execute(opts, callback) local handle = self.handle log.fmt_info("Executing installer for %s %s", handle.package, opts) - local context_cwd = InstallContextCwd.new(self.location) - local context_spawn = InstallContextSpawn.new(context_cwd, handle, false) - local context_fs = InstallContextFs.new(context_cwd) - local context = InstallContext.new(handle, context_cwd, context_spawn, context_fs, opts) + local context = InstallContext.new(handle, self.location, opts) local tailed_output = {} @@ -107,7 +101,7 @@ function InstallRunner:execute(opts, callback) context.receipt:with_start_time(vim.loop.gettimeofday()) -- 1. initialize working directory - try(context_cwd:initialize(handle)) + try(context.cwd:initialize()) -- 2. run installer ---@type async fun(ctx: InstallContext): Result |
