Case Sensitivity
andrewspode opened this issue · comments
-
git-notion version:
Latest, 0.2.4 -
Python version:
3.x -
Operating System:
Linux
Description
README.md is discovered but README.MD is not.
I would expect .MD to be picked up.
What I Did
General Use
for file in glob.glob("**/*.md", recursive=True):
This seems to be the offending line. From what I've discovered, it's case insensitive on Windows (as the underlying filesystem is) but sensitive on Linux.
I'm not a daily Python coder these days, so not sure what to suggest as a solution. There seem to be multiple approaches - but most of which seem to preload the list rather than iterate as it currently does - which might not be ideal on a large number of files.
If you don't have an obvious solution, I'm happy to come up with one and try it?
Technically, you shouldn't use the filename README.MD
, the extension should be lowercase. We should allow for passing a wildcard in as a parameter to use instead of **/*.md
. Maybe it can be a repeatable parameter. I suggest a param like:
@click.option('--wildcard', '-w', multiple=True)
Agreed, and I updated my repos accordingly. This is a good option - but if I understand correctly - you would need to then run it twice - once for .MD and another for .md ?
This is why I set multiple=True
. This allows you to set multiple values for a parameter and so you get a list of wildcards.
Perfect!