PHPCSStandards / composer-installer

Composer installer for PHP_CodeSniffer coding standards
https://packagist.org/packages/dealerdirect/phpcodesniffer-composer-installer
MIT License
559 stars 36 forks source link

PHPCS invocation fails on Windows 10 if installed globally #50

Closed jonathanjfshaw closed 4 years ago

jonathanjfshaw commented 6 years ago

Problem/Motivation

Running composer update in a project fails on Windows 10 when this plugin is installed globally.

Error

  [Symfony\Component\Process\Exception\ProcessFailedException]
  The command ""C:\users\jonathan\drupal\behatdrupal/vendor/bin\phpcs" "--config-show" "installed_paths"" failed.
  Exit Code: 1(General error)
  Working directory: C:\users\jonathan\drupal\behatdrupal
  Output:
  ================
  Error Output:
  =
===============
  '"C:\users\jonathan\drupal\behatdrupal/vendor/bin\phpcs"' is not recognized as an internal or external command,
  operable program or batch file.
frenck commented 6 years ago

Not sure why this is handled differently on Windows. I personally do not have access to Windows machines, so this needs to be solved/triaged by external contributors.

jrfnl commented 5 years ago

@jonathanjfshaw I haven't tested with a global install, but I wouldn't be surprised if PR #80 would fix this issue as well as it changes the command used.

Would you be able to test PR #80 with your setup ?

jonathanjfshaw commented 5 years ago

Sorry, no, I don't have a suitable working composer setup

Potherca commented 5 years ago

I'll have a look at this soonish, together with #79 and #80.

Potherca commented 4 years ago

Version v0.6.0 has just been released. Besides several fixes, this version also adds improved debug/verbose output.

@jonathanjfshaw Could you try to reproduce the issue you reported with v0.6.0 and let us know if it still happens? If so, please run the plugin in verbose mode and paste the output of the run here (that should make it possible for us to re-produce the issue ourselves).

jrfnl commented 4 years ago

@jonathanjfshaw Any feedback ? I would love to know if this is still an issue or if this can be closed.

jonathanjfshaw commented 4 years ago

Sorry, I'm no longer using composer on Windows 10 so can't retest.

Potherca commented 4 years ago

As luck would have it, I now have access to a Windows 10 machine (we've had to buy a family computer to keep up with all the video meetings the children have for school).

My current timetable would allow me to take a look at this the coming weekend. I'll post my findings as soon as I've run throught things. 👍

Potherca commented 4 years ago

I've finally gotten round to running this on a Windows machine.

Both powershell and regular shell give me no trouble with a global install present.

Closing this as it can not be reproduced.