diff options
| author | William Boman <william@redwill.se> | 2022-08-15 21:03:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-15 21:03:06 +0200 |
| commit | 3c62386a396ae0c1cd7adbaacc379eb4af072a65 (patch) | |
| tree | 4d00d20958839a04e6a996c11b97724c762e491a /lua/mason-core/managers/git/init.lua | |
| parent | chore: update generated code (#295) (diff) | |
| download | mason-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/managers/git/init.lua')
| -rw-r--r-- | lua/mason-core/managers/git/init.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lua/mason-core/managers/git/init.lua b/lua/mason-core/managers/git/init.lua index c363cbe8..aea3b47f 100644 --- a/lua/mason-core/managers/git/init.lua +++ b/lua/mason-core/managers/git/init.lua @@ -14,7 +14,7 @@ local function with_receipt(repo) end ---@async ----@param opts {[1]: string, recursive: boolean, version: Optional|nil}: The first item in the table is the repository to clone. +---@param opts {[1]: string, recursive: boolean, version: Optional?} The first item in the table is the repository to clone. function M.clone(opts) local ctx = installer.context() local repo = assert(opts[1], "No git URL provided.") @@ -37,7 +37,7 @@ function M.clone(opts) end ---@async ----@param receipt InstallReceipt +---@param receipt InstallReceipt<InstallReceiptPackageSource> ---@param install_dir string function M.check_outdated_git_clone(receipt, install_dir) if receipt.primary_source.type ~= "git" then @@ -51,14 +51,14 @@ function M.check_outdated_git_clone(receipt, install_dir) end return { name = receipt.primary_source.remote, - current_version = assert(local_head), - latest_version = assert(remote_head), + current_version = assert(local_head, "no local HEAD"), + latest_version = assert(remote_head, "no remote HEAD"), } end) end ---@async ----@param receipt InstallReceipt +---@param receipt InstallReceipt<InstallReceiptPackageSource> ---@param install_dir string function M.get_installed_revision(receipt, install_dir) return spawn |
