Files
neovim-config/lua/utils/cache_stats.lua
T

29 lines
1.0 KiB
Lua

-- ╭─────────────────────────────────────────────────────────╮
-- │ Cache Stats │
-- ╰─────────────────────────────────────────────────────────╯
local M = {}
-- Path to the cache script
local config_dir = vim.fn.stdpath("config") --[[@as string]]
local cache_script = vim.fs.joinpath(config_dir, "scripts", "update_cache.sh")
-- Flag to check if the script has already been run
local script_run_once = false
--- Function to run the cache script
---@return nil
function M.setup_script()
if not script_run_once then
-- Run the cache script
vim.system({ cache_script }, { detach = true }, function() end)
-- Prevent the script from running again
script_run_once = true
end
end
-- Run the setup script only once
M.setup_script()
return M