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/index/fourmolu/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/index/fourmolu/init.lua')
| -rw-r--r-- | lua/mason-registry/index/fourmolu/init.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lua/mason-registry/index/fourmolu/init.lua b/lua/mason-registry/index/fourmolu/init.lua new file mode 100644 index 00000000..f6849474 --- /dev/null +++ b/lua/mason-registry/index/fourmolu/init.lua @@ -0,0 +1,34 @@ +local Pkg = require "mason-core.package" +local github = require "mason-core.managers.github" +local _ = require "mason-core.functional" +local platform = require "mason-core.platform" +local std = require "mason-core.managers.std" + +return Pkg.new { + name = "fourmolu", + desc = [[A fork of Ormolu that uses four space indentation and allows arbitrary configuration.]], + homepage = "https://hackage.haskell.org/package/fourmolu", + languages = { Pkg.Lang.Haskell }, + categories = { Pkg.Cat.Formatter }, + ---@async + ---@param ctx InstallContext + install = function(ctx) + ---@param template string + local function release_file(template_string) + return _.compose(_.format(template_string), _.gsub("^v", "")) + end + + github + .download_release_file({ + repo = "fourmolu/fourmolu", + out_file = "fourmolu", + asset_file = _.coalesce( + _.when(platform.is.mac_x64, release_file "fourmolu-%s-osx-x86_64"), + _.when(platform.is.linux_x64_gnu, release_file "fourmolu-%s-linux-x86_64") + ), + }) + .with_receipt() + std.chmod("+x", { "fourmolu" }) + ctx:link_bin("fourmolu", "fourmolu") + end, +} |
