Skip to content

Commit

Permalink
feat: display message if git is not in path
Browse files Browse the repository at this point in the history
  • Loading branch information
agoodshort committed Jan 7, 2024
1 parent 30c2d89 commit d0a7c71
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ return {
}
```

### Requirements

- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
- [toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim)
- `git`

## Configuration

The extension comes with the following defaults:
Expand Down
25 changes: 15 additions & 10 deletions lua/telescope/_extensions/git_submodules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,18 @@ local show_repos = function(opts)
end
end

return require("telescope").register_extension({
setup = function(ext_config)
for k, v in pairs(ext_config) do
setup_opts[k] = v
end
end,
exports = {
git_submodules = show_repos,
},
})
if vim.fn.executable("git") == 0 then
print("telescope-git-submodules: git not in path. Cannot register extension.")
return
else
return require("telescope").register_extension({
setup = function(ext_config)
for k, v in pairs(ext_config) do
setup_opts[k] = v
end
end,
exports = {
git_submodules = show_repos,
},
})
end

0 comments on commit d0a7c71

Please sign in to comment.