generated from ellisonleao/nvim-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify deps, split off into sidebar class
- Loading branch information
Showing
3 changed files
with
107 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
local M = {} | ||
|
||
function M.check_deps(deps) | ||
local missing = {} | ||
for _, path in ipairs(deps) do | ||
local ok = pcall(require, path) | ||
if not ok then | ||
table.insert(missing, path) | ||
end | ||
end | ||
|
||
if #missing > 0 then | ||
error(string.format( | ||
"Magenta requires the following plugins: %s\nPlease install them to continue.", | ||
table.concat(missing, ", ") | ||
)) | ||
end | ||
end | ||
|
||
return M |