summaryrefslogtreecommitdiff
path: root/lua/lvim/utils/git.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-05-21 16:48:47 +0200
committerGitHub <[email protected]>2022-05-21 16:48:47 +0200
commit23df368b00bda0ed4a01fac92f7ad80998c1d34a (patch)
tree2362ff18ac68eab313380e814238fa15c1237934 /lua/lvim/utils/git.lua
parenta2454310b6c0b5b530521a77b9b8eb290274e040 (diff)
refactor: load the default options once (#2592)
BREAKING CHANGE: modifying the default options for keymaps and autocmds is now done by overwriting them, since they won't be loaded into the global `lvim` table anymore * refactor: use the lua-commands api * refactor!: use the lua-autocmds api * fix(settings): let neovim handle spellfile * feat: add log:set_log_level() * chore: update examples * chore: add deprecation notice for custom_groups
Diffstat (limited to 'lua/lvim/utils/git.lua')
-rw-r--r--lua/lvim/utils/git.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/lua/lvim/utils/git.lua b/lua/lvim/utils/git.lua
index f38a727f..81b1faf4 100644
--- a/lua/lvim/utils/git.lua
+++ b/lua/lvim/utils/git.lua
@@ -115,6 +115,20 @@ function M.get_lvim_tag()
return tag
end
+---Get currently running version of Lunarvim
+---@return string
+function M.get_lvim_version()
+ local current_branch = M.get_lvim_branch()
+
+ local lvim_version
+ if current_branch ~= "HEAD" or "" then
+ lvim_version = current_branch .. "-" .. M.get_lvim_current_sha()
+ else
+ lvim_version = "v" .. M.get_lvim_tag()
+ end
+ return lvim_version
+end
+
---Get the commit hash of currently checked-out commit of Lunarvim
---@return string|nil
function M.get_lvim_current_sha()