-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Behavior when specifying directory #139
Comments
Could we just show the usage and quit? I mean error out but hinting the user with a proper message on how to specify the glob pattern for the directory. |
That would work. My main question is what a user expects when specifying a directory. |
Probably makes sense for just checking files within that directory level, but not nested directories that would require a glob pattern. At least, users may be familiar with that with something like Otherwise bailing to inform the user that they probably meant The fact that a user may be unsure which of those two globbing outcomes would occur may make it better to throw the error and ask the user to be a bit more specific with what they'd like. |
You are right. Bailing makes sense as the behavior is ambiguous. Even worse, the link check could skip over files that the user thinks were included. Happy to accept a PR here. |
(Just also want to point out that @joesan had the same idea and that I like the teamwork on this one. 😆) |
This is supported in If multiple directories are given as arguments and one cannot be read it will exit with an error message as well. |
Open question: what should be the default behavior if a directory is given?
At the moment we throw and error and stop. Instead, the user has to use a
glob
pattern for recursion, e.g.**/*.md
.That doesn't seem to be very intuitive right now. See lycheeverse/lychee-action#3.
Here's my proposal:
If the user specifies a single directory, analyze all supported files (currently html/md/txt) within that directory.
This also holds if the user specifies a glob that implies a directory.
Any objections or concerns?
The text was updated successfully, but these errors were encountered: