I want to find all of the files in git that have some extensions. The list of extensions is generated from my .editorconfig file.
Say I have a list of file extensions such as:
.css
.html
.java
.js
(This is generated from .editorconfig)
I would like to find all of the files tracked by git that have these extensions.
At the moment, I have this command:
grep -oE "\.[a-z0-9]+" .editorconfig | xargs -I{} grep {} <(git ls-files)
The output is :
src/main/site/src/App.css
src/main/site/src/index.css
The command currently isn't running grep for each file extension, only the first one. What's wrong with the command? I want this to be a single command, without creating any intermediate files.
edit: The reason I generate the list of files from .editorconfig is because I want to check the code styles of each file generated by this command, and more files may be added to the config in the future, so I would like some future-proofing.