add comments to fs

This commit is contained in:
2025-05-06 17:13:12 -05:00
parent d6c37cf364
commit 47796d597e

View File

@ -3,12 +3,18 @@ local logger = require('dep.log')
local fs = {}
--- abstract away fs:link to make calling more intuitive
---@param package package package to update
---@param cb function callback on success
function fs:sync(package, cb)
if not package.exists then
fs:link(package, cb)
end
end
--- create a symlink to a local package
---@param package package package to link
---@param cb function callback on success
function fs:link(package, cb)
h.uv.fs_symlink(package.path, package.dir, nil, function(err, _)
if err then
@ -44,6 +50,7 @@ function fs:clean(package)
queue[pkg.name] = nil
end
-- start deleting all of the packages which are chosen for deletion
for name, dir in pairs(queue) do
local co = coroutine.create(function()
local ok = vim.fn.delete(dir, "rf")