Skip to content

Commit 536b5c8

Browse files
authored
feat(plugin): add healthcheck (#4)
* feat(healthcheck): add * docs(readme): add note on health check
1 parent af09460 commit 536b5c8

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ use 'kiran94/s3edit.nvim'
1515
- [`aws`](https://github.com/aws/aws-cli) in your `PATH` and configured
1616
- Neovim 0.8+
1717

18+
Once installed you can run a health check via `:checkhealth s3edit`
19+
1820
### Usage
1921

2022
Setup the plugin

Diff for: lua/s3edit/health.lua

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
local M = {}
2+
3+
M.check = function()
4+
vim.health.report_start("s3edit.nvim")
5+
6+
local executable = "aws"
7+
local is_executable = vim.fn.executable(executable) > 0
8+
9+
if is_executable then
10+
vim.health.report_ok(executable .. " found!")
11+
vim.health.report_info("make sure it is configured. You can check this by running: aws s3 ls")
12+
else
13+
vim.health.report_error(executable .. " is either not installed or is not within path")
14+
end
15+
end
16+
17+
return M

0 commit comments

Comments
 (0)