1. Summary
It would be nice if foreach-cli would ignore files and directories listed in the .gitignore file.
Perhaps it would be better if this feature were supported by default, as in fd, but if not, it would be nice to have at least an option.
2. Example of expected behavior
For example, a user has a .gitignore file with the content:
foreach-cli user run a command:
# [INFO] If “--gitignore” enabled by default:
foreach --execute "exampleclicommand {{path}}" --glob "**/*.txt"
# [INFO] If “--gitignore” is option:
foreach --execute "exampleclicommand {{path}}" --glob "**/*.txt" --gitignore
This command ignores all files in the node_modules folder recursively. The current equivalent of this command:
foreach --execute "exampleclicommand {{path}}" --glob "**/*.txt" --ignore "node_modules/**"
If the user for some reason wants to run exampleclicommand for the ignored node_modules folder, he needs to be able to do so. For example, like this:
# [INFO] If “--gitignore” enabled by default:
foreach --execute "exampleclicommand {{path}}" --glob "**/*.txt" --no-gitignore
3. Reason for needing feature
Every time I use foreach-cli for my real project, I have to ignore unwanted directories such as node_modules, .venv, .peru and various cache directories using the command-line argument --ignore. All these directories are already ignored in my .gitignore file. In such cases, the foreach-cli user is forced to use the --ignore argument with the same multiple values each time, which wastes his time and violates the DRY principle.
Thanks.
1. Summary
It would be nice if foreach-cli would ignore files and directories listed in the
.gitignorefile.Perhaps it would be better if this feature were supported by default, as in fd, but if not, it would be nice to have at least an option.
2. Example of expected behavior
For example, a user has a
.gitignorefile with the content:foreach-cli user run a command:
This command ignores all files in the
node_modulesfolder recursively. The current equivalent of this command:If the user for some reason wants to run
exampleclicommandfor the ignorednode_modulesfolder, he needs to be able to do so. For example, like this:3. Reason for needing feature
Every time I use foreach-cli for my real project, I have to ignore unwanted directories such as
node_modules,.venv,.peruand various cache directories using the command-line argument--ignore. All these directories are already ignored in my.gitignorefile. In such cases, the foreach-cli user is forced to use the--ignoreargument with the same multiple values each time, which wastes his time and violates the DRY principle.Thanks.