-
Notifications
You must be signed in to change notification settings - Fork 146
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(bundle-manager): blacklisted bundle directory names #357
Conversation
78a7b57
to
be13e96
Compare
Not sure there's a way to get this to rerun the security checks. |
Yeah, maybe I'm just trying to solve a problem I created for myself when I decided that my bundles directory should be one big git repo of submodules. Without this commit nodecg exits because |
There might be a better way though, I don't doubt that at all. Maybe just a couple blacklisted directory names and the ability to add a few exclusions in your |
Went with blacklisting |
Whoops, was able to get some new issues related to chokidar because the watchers don't adhere to the ignored directories. Unsure what the symlink limitations are, wasn't even sure nodecg resolved symlinks, but it's probably alright to just move this up into the bundle discovery loop. Whether that's before or after the semver compatibility check or not. Lines 190 to 194 in c39d45c
|
Change: Add the concept of blacklisted bundle directories, directories that can safely exist in your My use case for this was having my The currently ignored directories are the common things like As for a status, the ignoring works fine. There's some changes that need to be made to the chokidar logic though because it bypasses the concept of enabled/disabled bundles entirely and watches every folder in the bundles directory. |
There's already a check for whether the target is a directory and this ensures that we don't watch disabled/invalid bundles. Some of this logic is already sort of handled in that un-loaded bundles are declared invalid if they don't exist in a map of loaded bundles.
925640c
to
59c0ff8
Compare
Allows irrelevant folders (like
.git
) and invalid bundles to exist in the bundles directory without crashing.It's likely that the bundle-parser should be logging these errors and returning an undefined bundle instead to avoid using this blind try/catch. That'd mean passing in and constructing a new logger instance each time with the current implementation, though.