mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
refactor(lua): use vim.system #34707
This commit is contained in:

committed by
GitHub

parent
54b8c99e51
commit
35af766de6
@@ -25,14 +25,12 @@ function M.detect()
|
||||
end
|
||||
|
||||
-- if perl is available, make sure we have 5.22+
|
||||
vim.fn.system({ prog, '-e', 'use v5.22' })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
if vim.system({ prog, '-e', 'use v5.22' }):wait().code ~= 0 then
|
||||
return nil, 'Perl version is too old, 5.22+ required'
|
||||
end
|
||||
|
||||
-- if perl is available, make sure the required module is available
|
||||
vim.fn.system({ prog, '-W', '-MNeovim::Ext', '-e', '' })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
if vim.system({ prog, '-W', '-MNeovim::Ext', '-e', '' }):wait().code ~= 0 then
|
||||
return nil, '"Neovim::Ext" cpan module is not installed'
|
||||
end
|
||||
return prog, nil
|
||||
|
Reference in New Issue
Block a user