Skip to content

Commit 933052b

Browse files
committed
fix: ensure failed curl doesn't update the version
Related to #68
1 parent 326500e commit 933052b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lua/blink/cmp/fuzzy/download.lua

+11-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,16 @@ function download.get_git_tag(cb)
9090
local repo_dir = vim.fs.root(root_dir, '.git')
9191
if not repo_dir then return vim.schedule(function() return cb() end) end
9292

93-
vim.system({ 'git', '--git-dir', vim.fs.joinpath(repo_dir, '.git'), "--work-tree", repo_dir, 'describe', '--tags', '--exact-match' }, { cwd = root_dir }, function(out)
93+
vim.system({
94+
'git',
95+
'--git-dir',
96+
vim.fs.joinpath(repo_dir, '.git'),
97+
'--work-tree',
98+
repo_dir,
99+
'describe',
100+
'--tags',
101+
'--exact-match',
102+
}, { cwd = root_dir }, function(out)
94103
if out.code == 128 then return cb() end
95104
if out.code ~= 0 then
96105
return cb('While getting git tag, git exited with code ' .. out.code .. ': ' .. out.stderr)
@@ -118,7 +127,7 @@ function download.from_github(tag, cb)
118127
.. download.get_lib_extension()
119128

120129
vim.system({ 'curl', '--create-dirs', '-fLo', download.lib_path, url }, {}, function(out)
121-
if out.code ~= 0 then cb('Failed to download pre-build binaries: ' .. out.stderr) end
130+
if out.code ~= 0 then return cb('Failed to download pre-build binaries: ' .. out.stderr) end
122131
cb()
123132
end)
124133
end)

0 commit comments

Comments
 (0)