Skip to content

Commit

Permalink
Merge pull request #59 from tomasgareau/main
Browse files Browse the repository at this point in the history
  • Loading branch information
pocco81 authored Jan 27, 2022
2 parents 568d946 + 207da2f commit 24923c3
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lua/dap-install/config/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local settings = {}

settings.options = {
installation_path = vim.fn.stdpath("data") .. "/dapinstall/",
proxy = false
proxy = "",
}

function settings.set_options(opts)
Expand Down
31 changes: 26 additions & 5 deletions lua/dap-install/core/debuggers/ccppr_vsc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ M.config = {
},
}

M.installer = {
before = "",
install = string.format([[
wget -e https_proxy=%s $(curl -s https://api.github.com/repos/microsoft/vscode-cpptools/releases/latest -x %s| grep browser_ | cut -d\" -f 4 | grep linux.vsix)
local install_string
if proxy == nil or proxy == "" then
install_string = [[
wget $(curl -s https://api.github.com/repos/microsoft/vscode-cpptools/releases/latest | grep browser_ | cut -d\" -f 4 | grep linux.vsix)
mv cpptools-linux.vsix cpptools-linux.zip
unzip cpptools-linux.zip
chmod +x extension/debugAdapters/bin/OpenDebugAD7
Expand All @@ -56,7 +56,28 @@ M.installer = {
cd gdb-10.2/
./configure
make
]], proxy, proxy),
]]
else
install_string = string.format(
[[
wget -e https_proxy=%s $(curl -s https://api.github.com/repos/microsoft/vscode-cpptools/releases/latest -x %s| grep browser_ | cut -d\" -f 4 | grep linux.vsix)
mv cpptools-linux.vsix cpptools-linux.zip
unzip cpptools-linux.zip
chmod +x extension/debugAdapters/bin/OpenDebugAD7
cp extension/cppdbg.ad7Engine.json extension/debugAdapters/bin/nvim-dap.ad7Engine.json
wget https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.xz && tar -xvf gdb-10.2.tar.xz
cd gdb-10.2/
./configure
make
]],
proxy,
proxy
)
end

M.installer = {
before = "",
install = install_string,
uninstall = "simple",
}

Expand Down
21 changes: 17 additions & 4 deletions lua/dap-install/core/debuggers/python.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,25 @@ M.config = {
},
}

local install_string
if proxy == nil or proxy == "" then
install_string = [[
python3 -m venv .
bin/python -m pip install debugpy
]]
else
install_string = string.format(
[[
python3 -m venv .
bin/python -m pip install debugpy --proxy %s
]],
proxy
)
end

M.installer = {
before = "",
install = string.format([[
python3 -m venv .
bin/python -m pip install debugpy --proxy %s
]], proxy),
install = install_string,
uninstall = "simple",
}

Expand Down

0 comments on commit 24923c3

Please sign in to comment.