Gracefully handle missing memy binary and directory in memy-note.lua#3
Conversation
|
@copilot we should also check for presence of ~/memy dir since technically that could be checked out and memy is not installed globally |
Done — the guard now checks both conditions. Noting is only disabled (with a warning) when neither |
There was a problem hiding this comment.
Pull request overview
This PR improves the Neovim memy-note plugin’s startup behavior by explicitly detecting when neither the memy binary nor a local ~/memy checkout is available, and then warning and exiting early to avoid failures when attempting to run memy hook neovim.lua.
Changes:
- Added an upfront guard checking
vim.fn.executable("memy")andvim.fn.isdirectory("~/memy"). - Emits a WARN-level
vim.notifyand returns early only when both the binary and directory are missing. - Prevents the code path that shells out to
memy hook neovim.luafrom running whenmemyis unavailable.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Previously, if
memywasn't installed, the plugin would silently fail or error when trying to runmemy hook neovim.lua. This adds an upfront check that warns and exits early instead.Changes
memy-note.luathat checks bothvim.fn.executable("memy")and the presence of~/memyWARN-levelvim.notifyonly when both thememybinary is missing from$PATHand the~/memydirectory does not exist~/memyis checked out locally (without a globalmemybinary), the plugin proceeds as normal