Skip to content
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

showing dot files by default #2

Closed
akileez opened this issue Apr 19, 2021 · 8 comments
Closed

showing dot files by default #2

akileez opened this issue Apr 19, 2021 · 8 comments

Comments

@akileez
Copy link

akileez commented Apr 19, 2021

if (options.dot === false && file.name.startsWith('.')) return;

should this be || as opposed to && or something else? (in lib/sync as well)

after looking a little further, methinks the previous logic works due to options.dot never being initialized anywhere

if (options.dot !== true && file.name.startsWith('.')) return

btw, this is absolutely awesome!!!!!!!!!!!!!!!!!!!!!!

@jonschlinkert
Copy link
Member

btw, this is absolutely awesome!!!!!!!!!!!!!!!!!!!!!!

wow thanks for the kind words! I spent way too much time on this lol. I've been using it a lot locally and I really love the API, I hope other people get some value from it!

should this be || as opposed to && or something else? (in lib/sync as well)

ha @doowb mentioned something about this too. IMHO this should return dotfiles by default, and only exclude them when dot is false. It might even make more sense to remove that feature, since there are other easy ways to exclude dotfiles, like isMatch, or pushing the files into your own array inside onFile, etc.

Thoughts?

Thanks again! I was wondering how you were doing recently and was about to say hi, your ears must have been tingling!

jonschlinkert added a commit that referenced this issue Apr 19, 2021
@akileez
Copy link
Author

akileez commented Apr 19, 2021

I've been using it a lot locally and I really love the API

ME TOO!!! slowly moving it into my code base replacing other globs.

IMHO this should return dotfiles by default, and only exclude them when dot is false.

that's cool, no issues here. I was thrown off due to the readme file stating the default property for dot is set to false. Adjust the prop to true and confusion is gone. Having multiple way of accomplishing the goal is fine, I still prefer the direct method. keeps my coding simple.

I was wondering how you were doing recently and was about to say hi, your ears must have been tingling!

yes they were! been meaning to contact you as well. just started coding again about 6 months ago. Actually it was @doowb's tweet on Twitter about VS Code that got me back into coding. So thank him for me.

@jonschlinkert
Copy link
Member

ME TOO!!! slowly moving it into my code base replacing other globs.

wow thanks!

Adjust the prop to true and confusion is gone

good catch!

just started coding again about 6 months ago. Actually it was @doowb's tweet on Twitter about VS Code that got me back into coding. So thank him for me.

that's awesome! I was taking a break as well. Sounds like we both had some much needed time away.

I'm sure @doowb will see this message! and it doesn't surprise me that he said something that got you coding again, he inspires me too!

@jonschlinkert
Copy link
Member

@akileez I added some examples to the readme in case it might come in handy. The examples show pretty much exactly how I personally use this lib.

@doowb
Copy link
Member

doowb commented Apr 19, 2021

I was thrown off due to the readme file stating the default property for dot is set to false. Adjust the prop to true and confusion is gone.

I think this is the case... the default should be true and the example should be updated to something like this:

const files = await readdir('.');
console.log(files);
//=> ['.DS_Store', '.git', 'LICENSE', 'README.md', 'package.json']

const files = await readdir('.', { dot: false });
console.log(files);
//=> ['LICENSE', 'README.md', 'package.json']

Then, this will also match the options.dot tests.

just started coding again about 6 months ago. Actually it was @doowb's tweet on Twitter about VS Code that got me back into coding. So thank him for me.

This is awesome! I'm glad you're coding again :)

@akileez
Copy link
Author

akileez commented Apr 19, 2021

thanks @jonschlinkert. already using isMatch, just didn't realize though.

the last version it was called filter. So thanks for the heads up, I missed that one. had to look back at the documentation. filter is what originally caught my attention and I began using. It gave me a way to transpose globs by doing something like a glob-to-regex/string-to-regex conversion.

the on functions [onEach, onFile, etc] are like snipper/ninja tools to me. when I need something specific I will use them, otherwise the isMatch is the goto. see image for my typical all around collection usage.

and thanks again @doowb! ur the man!

rsync-gzip-proc3

@jonschlinkert
Copy link
Member

the last version it was called filter. So thanks for the heads up,

I'm so sorry, I know how lame this sounds but I looked at the dependents before I published and it looked like no one was using this besides me lol. So my brain wasn't in the the right place for writing a changelog. When you said you were using it, I should have updated the changelog!

I'll get something put together, but I don't think there are that many changes besides what we talked about already. I just wanted to get the API tightened up.

see image for my typical all around collection usage.

looks perfect to me!

@akileez
Copy link
Author

akileez commented Apr 19, 2021

but I looked at the dependents before I published and it looked like no one was using this besides me lol

no worries!!!!

I usually copy/paste directly from github, so it wouldn't show up in any stats. I started watching because it was that good! The symlink change happened and I copied that version as well. This is the only way I picked up the change with dot files. All three versions were running on the same data set.

If everything is fine, you are welcome to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy