only use the node cmd if it exists
This commit is contained in:
@@ -3,6 +3,11 @@ return {
|
||||
cmd = 'Copilot',
|
||||
event = 'InsertEnter',
|
||||
config = function()
|
||||
local node_cmd = nil
|
||||
local docker_node = vim.fn.expand('$HOME') .. '/.nvm/versions/node/v22.12.0/bin/node'
|
||||
if vim.fn.executable(docker_node) == 1 then
|
||||
node_cmd = docker_node
|
||||
end
|
||||
require('copilot').setup({
|
||||
filetypes = {
|
||||
yaml = false,
|
||||
@@ -17,7 +22,7 @@ return {
|
||||
cpp = true,
|
||||
['.'] = false,
|
||||
},
|
||||
copilot_node_command = vim.fn.expand('$HOME') .. '/.nvm/versions/node/v22.12.0/bin/node',
|
||||
copilot_node_command = node_cmd,
|
||||
suggestion = { enabled = false, auto_trigger = false },
|
||||
panel = { enabled = false },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user