aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/managers/dotnet/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-09-11 00:05:44 +0200
committerWilliam Boman <william@redwill.se>2025-02-16 09:32:29 +0100
commit2275067747a118d6002f421cb54f28affbc0ef98 (patch)
tree79bc1c2580ba96cc1b19e71f2b31f7c4c8ab490c /lua/mason-core/managers/dotnet/init.lua
parentchore(main): release 1.11.0 (#1658) (diff)
downloadmason-2275067747a118d6002f421cb54f28affbc0ef98.tar
mason-2275067747a118d6002f421cb54f28affbc0ef98.tar.gz
mason-2275067747a118d6002f421cb54f28affbc0ef98.tar.bz2
mason-2275067747a118d6002f421cb54f28affbc0ef98.tar.lz
mason-2275067747a118d6002f421cb54f28affbc0ef98.tar.xz
mason-2275067747a118d6002f421cb54f28affbc0ef98.tar.zst
mason-2275067747a118d6002f421cb54f28affbc0ef98.zip
refactor!: remove old managers (#1497)
Diffstat (limited to 'lua/mason-core/managers/dotnet/init.lua')
-rw-r--r--lua/mason-core/managers/dotnet/init.lua56
1 files changed, 0 insertions, 56 deletions
diff --git a/lua/mason-core/managers/dotnet/init.lua b/lua/mason-core/managers/dotnet/init.lua
deleted file mode 100644
index 984b2463..00000000
--- a/lua/mason-core/managers/dotnet/init.lua
+++ /dev/null
@@ -1,56 +0,0 @@
-local _ = require "mason-core.functional"
-local installer = require "mason-core.installer"
-local platform = require "mason-core.platform"
-
-local M = {}
-
-local create_bin_path = _.if_else(_.always(platform.is.win), _.format "%s.exe", _.identity)
-
----@param package string
-local function with_receipt(package)
- return function()
- local ctx = installer.context()
- ctx.receipt:with_primary_source(ctx.receipt.dotnet(package))
- end
-end
-
----@async
----@param pkg string
----@param opt { bin: string[]? }?
-function M.package(pkg, opt)
- return function()
- return M.install(pkg, opt).with_receipt()
- end
-end
-
----@async
----@param pkg string
----@param opt { bin: string[]? }?
-function M.install(pkg, opt)
- local ctx = installer.context()
- ctx.spawn.dotnet {
- "tool",
- "update",
- "--ignore-failed-sources",
- "--tool-path",
- ".",
- ctx.requested_version
- :map(function(version)
- return { "--version", version }
- end)
- :or_else(vim.NIL),
- pkg,
- }
-
- if opt and opt.bin then
- _.each(function(executable)
- ctx:link_bin(executable, create_bin_path(executable))
- end, opt.bin)
- end
-
- return {
- with_receipt = with_receipt(pkg),
- }
-end
-
-return M