Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lua/phpactor/check_uptodate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ return function()
return false
end

local network_status = os.execute("ping -c 2 8.8.8.8 > /dev/null 2>&1")
if network_status ~= 0 then
vim.notify("Network is not reachable, cannot check if Phpactor is up-to-date", vim.log.levels.ERROR, {
title = "Phpactor",
})

return
end

vim.fn.system({
config.options.install.git_bin,
"-C",
Expand Down
9 changes: 9 additions & 0 deletions lua/phpactor/handler/update.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
local config = require("phpactor.config")

return function()
local network_status = os.execute("ping -c 2 8.8.8.8 > /dev/null 2>&1")
if network_status ~= 0 then
vim.notify("Network is not reachable, cannot update Phpactor", vim.log.levels.ERROR, {
title = "Phpactor",
})

return
end

local Path = require("plenary.path")
local install_path = Path:new(config.options.install.path)
local phpactor_path = Path:new(config.options.install.path .. "phpactor/")
Expand Down
Loading