aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/path.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-08-15 21:03:06 +0200
committerGitHub <noreply@github.com>2022-08-15 21:03:06 +0200
commit3c62386a396ae0c1cd7adbaacc379eb4af072a65 (patch)
tree4d00d20958839a04e6a996c11b97724c762e491a /lua/mason-core/path.lua
parentchore: update generated code (#295) (diff)
downloadmason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.gz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.bz2
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.lz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.xz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.zst
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.zip
refactor: introduce selene, harden type defs, and use proper EmmyLua syntax (#296)
Diffstat (limited to 'lua/mason-core/path.lua')
-rw-r--r--lua/mason-core/path.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/lua/mason-core/path.lua b/lua/mason-core/path.lua
index 2060c186..5986c1d7 100644
--- a/lua/mason-core/path.lua
+++ b/lua/mason-core/path.lua
@@ -9,7 +9,7 @@ local sep = (function()
return "\\"
end
else
- return package.config:sub(1, 1)
+ return string.sub(package.config, 1, 1)
end
end)()
@@ -27,23 +27,23 @@ function M.is_subdirectory(root_path, path)
return root_path == path or path:sub(1, #root_path + 1) == root_path .. sep
end
----@param dir string|nil
+---@param dir string?
function M.install_prefix(dir)
local settings = require "mason.settings"
return M.concat { settings.current.install_root_dir, dir }
end
----@param executable string|nil
+---@param executable string?
function M.bin_prefix(executable)
return M.concat { M.install_prefix "bin", executable }
end
----@param name string|nil
+---@param name string?
function M.package_prefix(name)
return M.concat { M.install_prefix "packages", name }
end
----@param name string|nil
+---@param name string?
function M.package_build_prefix(name)
return M.concat { M.install_prefix ".packages", name }
end