Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plenary "no such file or directory" error if broken symlinks present #77

Closed
dnebauer opened this issue Jan 5, 2024 · 2 comments · Fixed by #79
Closed

plenary "no such file or directory" error if broken symlinks present #77

dnebauer opened this issue Jan 5, 2024 · 2 comments · Fixed by #79

Comments

@dnebauer
Copy link

dnebauer commented Jan 5, 2024

On my first attempted use of this plugin I tried the HawtkeysAll command and got the following error:

E5108: Error executing lua ....local/share/nvim/lazy/plenary.nvim/lua/plenary/path.lua:743: ENOENT: no such file or directory: /home/USER/.config/nvim/lua/config/test_file.lua
stack traceback:
	[C]: in function 'assert'
	....local/share/nvim/lazy/plenary.nvim/lua/plenary/path.lua:743: in function 'read'
	....local/share/nvim/lazy/hawtkeys.nvim/lua/hawtkeys/ts.lua:141: in function 'find_maps_in_file'
	....local/share/nvim/lazy/hawtkeys.nvim/lua/hawtkeys/ts.lua:473: in function 'show_all'
	....local/share/nvim/lazy/hawtkeys.nvim/lua/hawtkeys/ui.lua:264: in function 'show_all'
	[string ":lua"]:1: in main chunk

The file path given in the error message was a broken symlink. The broken symlink was some cruft and I took the opportunity to remove it, after which the plugin command worked fine.

If you're happy for the plugin command to fail on a broken symlink please feel free to close this issue -- I can't think of a situation where a user would want to keep broken symlinks, and they might appreciate your plugin bringing these broken links to their attention.

Alternatively, you might want the plugin to handle this situation more gracefully, perhaps silently ignoring broken symlinks.

@tris203
Copy link
Owner

tris203 commented Jan 5, 2024

Hi @dnebauer thank you for letting me know

I wonder if this could be handled in #70 as part of the work @willothy is doing

@willothy
Copy link
Collaborator

willothy commented Jan 5, 2024

Yeah that definitely falls under the scope of that issue. We do pretty much no path validation right now, which could definitely lead to a lot of issues. I will make sure to use libuv to check to symlinks and such in the PR for that. Should hopefully have a draft up at least later today.

@willothy willothy linked a pull request Jan 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants