test: unit (#97)

* refactor(utils): remove unused function

* fix(installer): actually pass what should be passed

* docs: add explanation comment

* test: add utils

* refactor(utils): flatten the dir of files

* remove .luarc
This commit is contained in:
Smirnov Oleksandr 2025-03-21 22:10:40 +02:00 committed by Oleksandr Smirnov
parent 9aa0038125
commit 7af08c9780
No known key found for this signature in database
8 changed files with 39 additions and 26 deletions

View file

@ -15,12 +15,17 @@ local urls = {
---@param url string
local function handle_intall_exit(opt, url)
if opt.code ~= 0 then
u.deferred_notify("go install failed: " .. url)
vim.schedule(function()
u.notify("go install failed: " .. url)
end)
log.error("go install failed:", "url", url, "opt", vim.inspect(opt))
return
end
u.deferred_notify("go install-ed: " .. url)
vim.schedule(function()
u.notify("go install-ed: " .. url)
end)
end
---@param url string
@ -40,7 +45,7 @@ end
---@param opts? {sync:boolean}
function installer.install_deps(opts)
opts = opts or {}
for url, _ in pairs(urls) do
for _, url in pairs(urls) do
if opts.sync then
install_sync(url)
else