Files
neovim-config/lua/utils/cache_stats.lua
T
rootiest 6a17dac714 ️ perf(cache_stats): ensure only one instance
Ensures only a single instance of the cache_stats script is active
2024-08-09 05:36:04 -04:00

25 lines
944 B
Lua

-- ╭─────────────────────────────────────────────────────────╮
-- │ Cache Stats │
-- ╰─────────────────────────────────────────────────────────╯
local M = {}
local config_dir = vim.fn.stdpath("config")
local cache_script = 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 update script using vim.system
function M.setup_script()
if not script_run_once then
vim.system({ cache_script }, { detach = true }, function() end)
script_run_once = true
end
end
-- Run the setup script only once
M.setup_script()
return M