First of all, PHP_CodeSniffer is the best and it helps me make coding better. There are many editor plugins that use it too and my PHP source codes are now very beautiful.
But, there is an issue about generating phpcs.bat on Windows. When running composer install from Windows, there is a phpcs.bat generated, this file is being used by many editor plugins. The problem is I use docker with linux container and run composer install in it, there is no phpcs.bat after that. So, I need to re-install phpcs from Windows to solve the problem.
I think it will be better if we always generate the phpcs.bat in any OS.
Thank you.
Are you sure composer install is giving you a phpcs.bat file? I don't tell composer to do that, but I do have a config for the pear installer so it only generates a phpcs.bat if you are on windows.
I didn't use pear. I just only use composer to install phpcs from composer.json. So weird...
Ah, composer is adding .bat files for you: https://getcomposer.org/doc/articles/vendor-binaries.md#what-about-windows-and-bat-files-
I guess composer only does this when it is run on Windows.
Yeah. And that's the problem. It generates .bat file only in Windows. There are anything you can help? It'll be better if .bat file is always generated.
There are anything you can help?
I don't think so. The docs say that even if I want my own custom .bat file, I still shouldn't list it in the composer.json, which means I don't get to decide if it gets installed or not, and I don't even control the content of it (the .bat file in the git repo only works when PEAR installed).
I think you'd have to put in a feature request with the composer project, or ask if there is a workaround to force the creation of the .bat file for you.
I got it. Thank you so much. You can close this issue.
If you landed here when searching for always generating .bat files with composer;
Most helpful comment
If you landed here when searching for always generating .bat files with composer;
See: https://github.com/composer/composer/issues/7370