summaryrefslogtreecommitdiff
path: root/lua/bootstrap.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/bootstrap.lua')
-rw-r--r--lua/bootstrap.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua
index 85d39d2d..5e333d8a 100644
--- a/lua/bootstrap.lua
+++ b/lua/bootstrap.lua
@@ -32,6 +32,15 @@ function _G.get_cache_dir()
return lvim_cache_dir
end
+function _G.get_version(type)
+ local lvim_full_ver = vim.fn.system("git -C " .. get_runtime_dir() .. "/lvim describe --tag")
+ if type == "short" then
+ return vim.fn.split(lvim_full_ver, "-")[1]
+ else
+ return string.sub(lvim_full_ver, 1, #lvim_full_ver - 1)
+ end
+end
+
function M:init()
self.runtime_dir = get_runtime_dir()
self.config_dir = get_config_dir()