diff options
| author | William Boman <william@redwill.se> | 2023-02-20 22:19:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-20 22:19:39 +0100 |
| commit | b8a6632a0f2d263199d5d480ca85477fe0f414ab (patch) | |
| tree | 57e1ee0f3cef078ec144ecdf1b2fa861acf47755 /lua/mason-registry/cbfmt/init.lua | |
| parent | chore: autogenerate (#1015) (diff) | |
| download | mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.gz mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.bz2 mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.lz mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.xz mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.zst mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.zip | |
feat: configurable registries (#1016)
Diffstat (limited to 'lua/mason-registry/cbfmt/init.lua')
| -rw-r--r-- | lua/mason-registry/cbfmt/init.lua | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/lua/mason-registry/cbfmt/init.lua b/lua/mason-registry/cbfmt/init.lua deleted file mode 100644 index 1fda9ce7..00000000 --- a/lua/mason-registry/cbfmt/init.lua +++ /dev/null @@ -1,49 +0,0 @@ -local Pkg = require "mason-core.package" -local platform = require "mason-core.platform" -local _ = require "mason-core.functional" -local github = require "mason-core.managers.github" -local path = require "mason-core.path" - -local coalesce, when = _.coalesce, _.when - -return Pkg.new { - name = "cbfmt", - desc = _.dedent [[ - A tool to format codeblocks inside markdown and org documents. It iterates over all codeblocks, and formats them - with the tool(s) specified for the language of the block. - ]], - homepage = "https://github.com/lukas-reineke/cbfmt", - languages = { Pkg.Lang.Markdown }, - categories = { Pkg.Cat.Formatter }, - ---@async - ---@param ctx InstallContext - install = function(ctx) - local asset_file = coalesce( - when(platform.is.mac, "cbfmt_macos-x86_64_%s.tar.gz"), - when(platform.is.linux_x64_gnu, "cbfmt_linux-x86_64_%s.tar.gz"), - when(platform.is.linux_x64_musl, "cbfmt_linux-x86_64-musl_%s.tar.gz"), - when(platform.is.win_x64, "cbfmt_windows-x86_64-msvc_%s.zip") - ) - - local source = platform.when { - unix = function() - return github.untargz_release_file { - repo = "lukas-reineke/cbfmt", - asset_file = _.format(asset_file), - } - end, - win = function() - return github.unzip_release_file { - repo = "lukas-reineke/cbfmt", - asset_file = _.format(asset_file), - } - end, - } - source.with_receipt() - local strip_extension = _.compose(_.gsub("%.zip$", ""), _.gsub("%.tar%.gz$", "")) - ctx:link_bin( - "cbfmt", - path.concat { strip_extension(source.asset_file), platform.is.win and "cbfmt.exe" or "cbfmt" } - ) - end, -} |
