NarekA / git-notion

Pushes markdown documents from Github to Notion
MIT License
174 stars 28 forks source link

Case Sensitivity #4

Closed andrewspode closed 2 years ago

andrewspode commented 2 years ago

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?

NarekA commented 2 years ago

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)
andrewspode commented 2 years ago

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 ?

NarekA commented 2 years ago

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.

andrewspode commented 2 years ago

Perfect!