only use the node cmd if it exists
This commit is contained in:
@@ -3,6 +3,11 @@ return {
|
|||||||
cmd = 'Copilot',
|
cmd = 'Copilot',
|
||||||
event = 'InsertEnter',
|
event = 'InsertEnter',
|
||||||
config = function()
|
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({
|
require('copilot').setup({
|
||||||
filetypes = {
|
filetypes = {
|
||||||
yaml = false,
|
yaml = false,
|
||||||
@@ -17,7 +22,7 @@ return {
|
|||||||
cpp = true,
|
cpp = true,
|
||||||
['.'] = false,
|
['.'] = 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 },
|
suggestion = { enabled = false, auto_trigger = false },
|
||||||
panel = { enabled = false },
|
panel = { enabled = false },
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user