From 3c62386a396ae0c1cd7adbaacc379eb4af072a65 Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 15 Aug 2022 21:03:06 +0200 Subject: refactor: introduce selene, harden type defs, and use proper EmmyLua syntax (#296) --- lua/mason-core/path.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lua/mason-core/path.lua') 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 -- cgit v1.2.3-70-g09d2