php - Including and excluding globbing patterns in bash -


i trying use phpcompatibility standard php codesniffer test specific set of files.

i'm using find this.

find ./path1 ./path2 ./path3 ./path4                                                \     -type f                                                                         \     -name '*.php'                                                                   \     -not -path './path4/dontwantthis/*'                                             \     -exec ./vendor/bin/phpcs                                                        \     --standard=phpcompatibility --runtime-set testversion 5.6 {}                    \; 

however, slow , inefficient because startup script runs every single file.

the phpcs script takes in path ./vendor/bin/phpcs --standard=phpcompatibility --runtime-set testversion 5.6 <path-of-your-php-files> , i'd find way replicate find stuff globbing pattern in place of <path-of-your-php-files>

one of major problems having including ./path4/*.php while excluding ./path4/dontwantthis/*

end -exec option + instead of \;. tells find run command once filenames, rather separately each filename.

find ./path1 ./path2 ./path3 ./path4                                                \     -type f                                                                         \     -name '*.php'                                                                   \     -not -path './path4/dontwantthis/*'                                             \     -exec ./vendor/bin/phpcs                                                        \     --standard=phpcompatibility --runtime-set testversion 5.6 {} + 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -