nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
18.9k stars 21.68k forks source link

fix(lazy): added error handling for bootstrap #1001

Closed folke closed 2 months ago

folke commented 3 months ago

Too many people seem to have faulty git configuration that make the initial clone fail.

This PR adds error handling in case the bootstrap fails.

I've add a simple error, but if a prettier error message is wanted, you could use:

  if vim.v.shell_error ~= 0 then
    vim.api.nvim_echo({
      { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
      { out, "WarningMsg" },
      { "\nPress any key to exit..." },
    }, true, {})
    vim.fn.getchar()
    os.exit(1)
  end