alok8bb / cloneit

A cli tool to download specific GitHub directories or files
MIT License
74 stars 2 forks source link

feat: support `NO_COLOR` and `FORCE_COLOR`, remove progress bar #12

Closed uncenter closed 3 months ago

uncenter commented 3 months ago

Currently a draft as I have yet to reimplement the progress bar (personally I don't think the bar is necessary, but I'll try to add it - possibly using https://docs.rs/indicatif/0.17.8/indicatif/ this time). Switches to using https://docs.rs/yansi/latest/yansi/index.html for terminal coloring, which is configured to disable color with https://no-color.org/ or enable it with https://force-color.org/.

Related to a comment in #8.

alok8bb commented 3 months ago

I had previously tried https://docs.rs/indicatif/0.17.8/indicatif/, but I couldn't get it to work properly or it didn't look good, so I switched to https://github.com/clitic/kdam instead. It works great, and there are different types of progress bars in the example directory. Perhaps we could use one of those simpler styles instead of the colorful, verbose ones?

uncenter commented 3 months ago

As mentioned in #8 by you:

Hmm true progress bar is kinda useless I just added it for fun but it's good to have some sort of progress indicator. 🤔

I don't think a progress bar showing the downloading progress of each file makes sense, but maybe we can get a list of all files first and use that as the total to count up towards? Then again that seems architecturally difficult to do and doesn't maybe give enough value.

alok8bb commented 3 months ago

Uh yea, it's not really useful. And getting list of files and showing progress based on total count seems too much. But removing the progress bar will be weird, we'll have no progress being displayed.

uncenter commented 3 months ago

We can just print each of the filenames being downloaded? That's a pretty good indication of progress!

alok8bb commented 3 months ago

Yeah, that works! 😃

alok8bb commented 3 months ago

Thanks for adding NO_COLOR support! Great contribution, much appreciated.