The following command detects if any of the staged files in git is myFile.js:
echo $(git diff --cached --name-only --diff-filter=ACM | egrep 'path/to/myFile.jsx?$')
But I want to detect any .js file in that folder. I tried this but it didn't work:
echo $(git diff --cached --name-only --diff-filter=ACM | egrep 'path/to/{*}.jsx?$')
How to add a wild card for the filename here?
echo $(somecommand)-- theechoand the$( )mostly cancel each other out, except for some potential parsing weirdnesses in between them. Just run the command directly (unless you want those parsing weirdnesses for some reason).