Skip to content

Commit 69e2d38

Browse files
authored
Revert "perf(build): async run to avoid blocking (#46)" (#48)
This reverts commit 814a927.
1 parent 814a927 commit 69e2d38

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lua/colorbox.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ local function update()
295295
vim.inspect(data)
296296
)
297297
local lines = {}
298-
for _, d in ipairs(data) do
299-
if type(d) == "string" and string.len(vim.trim(d)) > 0 then
300-
table.insert(lines, d)
298+
for _, line in ipairs(data) do
299+
if string.len(vim.trim(line)) > 0 then
300+
table.insert(lines, line)
301301
end
302302
end
303303
if #lines > 0 then
@@ -323,7 +323,6 @@ local function update()
323323
logger.debug("update command:%s", vim.inspect(cmd))
324324
local jobid = vim.fn.jobstart(cmd, {
325325
cwd = spec.full_pack_path,
326-
detach = true,
327326
stdout_buffered = true,
328327
stderr_buffered = true,
329328
on_stdout = _on_output,
@@ -337,16 +336,18 @@ local function update()
337336
logger.debug("install command:%s", vim.inspect(cmd))
338337
local jobid = vim.fn.jobstart(cmd, {
339338
cwd = home_dir,
340-
detach = true,
341339
stdout_buffered = true,
342340
stderr_buffered = true,
343341
on_stdout = _on_output,
344342
on_stderr = _on_output,
345343
on_exit = _on_exit,
346344
})
345+
logger.debug("installing %s", vim.inspect(handle))
347346
table.insert(jobs, jobid)
348347
end
349348
end
349+
vim.fn.jobwait(jobs)
350+
logger.close_file_mode_w()
350351
end
351352

352353
local M = { setup = setup, update = update }

0 commit comments

Comments
 (0)