diff options
author | chaesngmin <[email protected]> | 2021-09-17 04:13:52 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-17 04:13:52 -0700 |
commit | 254ab2102b5f8f6187321a545998ead4c3abd27a (patch) | |
tree | 8f329f66cc4d62c6964d3925bbb40f0988f351d3 /lua/bootstrap.lua | |
parent | eab0369ae8688b23946a8a9e6dab6061ec0c554a (diff) |
[Feature] Add lunarvim latest release tag to dashboard (#1436)
* feat: add lunarvim latest release tag to dashboard
* Add a function to center-align text
Rename align to align_left
Rename shift_left to shift_right
* refactor(dashboard): remove unnecessary comment
* refactor(dashboard): use `home_dir` variable for `lv_path`
* refactor(dashboard): use $LUNARVIM_RUNTIME_DIR for lv_path
* feat(bootstrap): add fn that returns lvim version
* refactor(dashboard): use version, lunarvim dir with bootstrap fns
* build: add global get_version() from bootstrap
Co-authored-by: Luc Sinet <[email protected]>
Diffstat (limited to 'lua/bootstrap.lua')
-rw-r--r-- | lua/bootstrap.lua | 9 |
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() |