diff options
| author | William Boman <william@redwill.se> | 2022-09-20 17:26:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-20 17:26:09 +0200 |
| commit | ef37c13442417d26e685f15b5554e9d55db2cd70 (patch) | |
| tree | 85601f629ac7ed208203eaea310962ca84ffc5db /lua | |
| parent | feat: add ruby-lsp (#446) (diff) | |
| download | mason-ef37c13442417d26e685f15b5554e9d55db2cd70.tar mason-ef37c13442417d26e685f15b5554e9d55db2cd70.tar.gz mason-ef37c13442417d26e685f15b5554e9d55db2cd70.tar.bz2 mason-ef37c13442417d26e685f15b5554e9d55db2cd70.tar.lz mason-ef37c13442417d26e685f15b5554e9d55db2cd70.tar.xz mason-ef37c13442417d26e685f15b5554e9d55db2cd70.tar.zst mason-ef37c13442417d26e685f15b5554e9d55db2cd70.zip | |
feat(gem): ensure bin path exist when linking (#449)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/mason-core/managers/gem/init.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/mason-core/managers/gem/init.lua b/lua/mason-core/managers/gem/init.lua index 0cbca3ae..0f26fafb 100644 --- a/lua/mason-core/managers/gem/init.lua +++ b/lua/mason-core/managers/gem/init.lua @@ -6,6 +6,7 @@ local spawn = require "mason-core.spawn" local Optional = require "mason-core.optional" local installer = require "mason-core.installer" local platform = require "mason-core.platform" +local fs = require "mason-core.fs" local M = {} @@ -27,6 +28,9 @@ end, _.if_else(_.always(platform.is.win), _.format "%s.bat", _.identity)) local function link_executable(executable) local ctx = installer.context() local bin_path = create_bin_path(executable) + if not ctx.fs:file_exists(bin_path) then + error(("Cannot link Gem executable %q because it doesn't exist in %q."):format(executable, bin_path), 0) + end ctx:link_bin( executable, ctx:write_shell_exec_wrapper(executable, path.concat { ctx.package:get_install_path(), bin_path }, { |
