|
43 | 43 | ---@param local_server_zip_filepath string
|
44 | 44 | ---@return boolean
|
45 | 45 | local function download_file_with_wget(url, local_server_zip_filepath)
|
46 |
| - return false |
47 |
| - -- if vim.fn.executable("wget") == 0 then |
48 |
| - -- return false |
49 |
| - -- end |
50 |
| - -- |
51 |
| - -- local wget_cmd = string.format('wget -O "%s" "%s"', local_server_zip_filepath:gsub("\\", "\\\\"), url) |
52 |
| - -- logger.trace("Downloading copilot-language-server with command: " .. wget_cmd) |
53 |
| - -- local result = vim.fn.system(wget_cmd) |
54 |
| - -- |
55 |
| - -- if vim.v.shell_error ~= 0 then |
56 |
| - -- logger.error("error downloading file with wget: " .. result) |
57 |
| - -- return false |
58 |
| - -- end |
59 |
| - -- |
60 |
| - -- return true |
| 46 | + if vim.fn.executable("wget") == 0 then |
| 47 | + return false |
| 48 | + end |
| 49 | + |
| 50 | + local wget_cmd = string.format('wget -O "%s" "%s"', local_server_zip_filepath:gsub("\\", "\\\\"), url) |
| 51 | + logger.trace("Downloading copilot-language-server with command: " .. wget_cmd) |
| 52 | + local result = vim.fn.system(wget_cmd) |
| 53 | + |
| 54 | + if vim.v.shell_error ~= 0 then |
| 55 | + logger.error("error downloading file with wget: " .. result) |
| 56 | + return false |
| 57 | + end |
| 58 | + |
| 59 | + return true |
61 | 60 | end
|
62 | 61 |
|
63 | 62 | ---@param url string
|
64 | 63 | ---@param local_server_zip_filepath string
|
65 | 64 | ---@return boolean
|
66 | 65 | local function download_file_with_curl(url, local_server_zip_filepath)
|
67 |
| - return false |
68 |
| - -- if vim.fn.executable("curl") == 0 then |
69 |
| - -- return false |
70 |
| - -- end |
71 |
| - -- |
72 |
| - -- local cmd = string.format('curl -s -L -o "%s" "%s"', local_server_zip_filepath:gsub("\\", "\\\\"), url) |
73 |
| - -- logger.trace("downloading copilot-language-server with command: " .. cmd) |
74 |
| - -- local result = vim.fn.system(cmd) |
75 |
| - -- |
76 |
| - -- if vim.v.shell_error ~= 0 then |
77 |
| - -- logger.error("error downloading file: " .. result) |
78 |
| - -- return false |
79 |
| - -- end |
80 |
| - -- |
81 |
| - -- return true |
| 66 | + if vim.fn.executable("curl") == 0 then |
| 67 | + return false |
| 68 | + end |
| 69 | + |
| 70 | + local cmd = string.format('curl -s -L -o "%s" "%s"', local_server_zip_filepath:gsub("\\", "\\\\"), url) |
| 71 | + logger.trace("downloading copilot-language-server with command: " .. cmd) |
| 72 | + local result = vim.fn.system(cmd) |
| 73 | + |
| 74 | + if vim.v.shell_error ~= 0 then |
| 75 | + logger.error("error downloading file: " .. result) |
| 76 | + return false |
| 77 | + end |
| 78 | + |
| 79 | + return true |
82 | 80 | end
|
83 | 81 |
|
84 | 82 | ---@param url string
|
|
0 commit comments