I would like to mass-update files in a script, using the following command:
grep -l -r -E "..." . | while read -r FILE ; do
# How to do the next line only for files that are not in submodules?
sed -i '' -E '...' "${FILE}"
done
However, I have git submodules and do not want to update files contained in those submodules. Short of maintaining a blacklist of paths where the submodules are, is there any way to check if a file belongs to a submodule or skip them altogether?