diff options
| author | William Boman <william@redwill.se> | 2023-10-13 21:14:29 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2025-02-19 09:23:19 +0100 |
| commit | ae208dc380808ff1aef39929a0e897e881571d43 (patch) | |
| tree | b9044cec7223062db69998189c76f8163ac9d58b /lua/mason-core/installer/runner.lua | |
| parent | fix(location): use correct registry path (diff) | |
| download | mason-ae208dc380808ff1aef39929a0e897e881571d43.tar mason-ae208dc380808ff1aef39929a0e897e881571d43.tar.gz mason-ae208dc380808ff1aef39929a0e897e881571d43.tar.bz2 mason-ae208dc380808ff1aef39929a0e897e881571d43.tar.lz mason-ae208dc380808ff1aef39929a0e897e881571d43.tar.xz mason-ae208dc380808ff1aef39929a0e897e881571d43.tar.zst mason-ae208dc380808ff1aef39929a0e897e881571d43.zip | |
refactor: standardize constructors and improve inheritance construction
Diffstat (limited to 'lua/mason-core/installer/runner.lua')
| -rw-r--r-- | lua/mason-core/installer/runner.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lua/mason-core/installer/runner.lua b/lua/mason-core/installer/runner.lua index 3e3580e5..64aa605d 100644 --- a/lua/mason-core/installer/runner.lua +++ b/lua/mason-core/installer/runner.lua @@ -20,12 +20,14 @@ InstallRunner.__index = InstallRunner ---@param location InstallLocation ---@param handle InstallHandle ---@param semaphore Semaphore -function InstallRunner.new(location, handle, semaphore) - return setmetatable({ - location = location, - semaphore = semaphore, - handle = handle, - }, InstallRunner) +function InstallRunner:new(location, handle, semaphore) + ---@type InstallRunner + local instance = {} + setmetatable(instance, self) + instance.location = location + instance.semaphore = semaphore + instance.handle = handle + return instance end ---@param opts PackageInstallOpts @@ -34,7 +36,7 @@ function InstallRunner:execute(opts, callback) local handle = self.handle log.fmt_info("Executing installer for %s %s", handle.package, opts) - local context = InstallContext.new(handle, self.location, opts) + local context = InstallContext:new(handle, self.location, opts) local tailed_output = {} |
