adamreisnz / replace-in-file

A simple utility to quickly replace contents in one or more files
580 stars 65 forks source link

File paths starting with dot are skipped #133

Closed k2snowman69 closed 3 years ago

k2snowman69 commented 3 years ago

Reproduction:

  1. Create a new empty directory named example
  2. Create a file.test in the new directory with the text coverage inside of it
  3. Run npx replace-in-file "coverage" "coverage-2" example/**

Expected: One file to be changed

Actual: No files were changed

Current workaround: Explicitly add dot files into the command npx replace-in-file "coverage" "coverage-2" example/**,example/**/.*

adamreisnz commented 3 years ago

I suspect that is how glob works, as we use glob to match files for us. You can probably specify glob configuration to address this, see:

https://github.com/adamreisnz/replace-in-file#specify-glob-configuration

Or your work around, as mentioned. Let me know if you think the problem lies with the package instead of glob.

k2snowman69 commented 3 years ago

I'm embarrassed I didn't think of that. Thanks! Looks like the particular setting is likely

dot:true
adamreisnz commented 3 years ago

Yes that's the one, no worries 👍