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

feat(docs): skip docs task for read-only directories #1897

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sei40kr
Copy link

@sei40kr sei40kr commented Jan 21, 2025

Description

Skip docs task for plugins in read-only directories to avoid errors.

This assumes a case where, for example, lazy.nvim references a plugin in the Nix store.

@@ -87,7 +87,7 @@ M.build = {

M.docs = {
skip = function(plugin)
return not plugin._.is_local and not plugin._.dirty
return not plugin._.is_local and not plugin._.dirty or not vim.uv.fs_access(plugin.dir, "W")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the plugin is not local, it is likely not read-only, in which case it may save IO costs by not checking permissions.

Suggested change
return not plugin._.is_local and not plugin._.dirty or not vim.uv.fs_access(plugin.dir, "W")
return not plugin._.is_local and not plugin._.dirty or plugin._.is_local and not vim.uv.fs_access(plugin.dir, "W")

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 this pull request may close these issues.

1 participant