[SOLVED] How can i exclude directories when is use i18ndude command

Hi all,

In my AddOn Package i have a "node_modules" Directory. If i run the command, the compilation fails, if i remove the node_modules directory all is fine:

./bin/i18ndude rebuild-pot --pot ./src/myaddon.project/src/myaddon/project/locales/myaddon.project.pot --create myaddon.project ./src/myaddon.sosnet/src/myaddon/project/ --exclude "./src/myaddon.project/src/myaddon/project/theme/node_modules*"

Is it even possible to exclude directories?

The i18ndude documentation says that --exclude takes a sequence of whitespace delimited filenames or regular expressions for filenames as argument. You have provided a "glob pattern" (which is not a regular expression).

Maybe, omitting the trailing * already will work. Otherwise, you could try .../node_modules/.*. If this should fail as well, you could compile a list of filenames in whatever way appropriate in a shell variable (say $exclude) and then use --exclude "$exclude".

It could even be that i18ndude works on the names of the files rather than their paths. Look at its source to find out.

Thanks for the hint. I use now:

--exclude "\( ! -name node_modules \)"

and all is good!

This does not work with
./bin/i18ndude rebuild-pot --pot src/my/ultest/locales//my.ultest.pot --exclude "\( ! -name node_modules \)" --create my.ultest src/my/ultest/
It still find node_modules.

Looking at

There only the file name is checked by fnmatch, not the whole path. Too bad.

For now I ignore "*.html *json-schema*.xml" which excludes all problematic files in node_modules and does not affect any Plone specific files.