Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Composer scripts/commands broken in 0.6.0 update #105

Merged
merged 1 commit into from Jan 29, 2020

Conversation

BrianHenryIE
Copy link
Contributor

After the 0.6.0 update, Composer's scripts/post-install-cmd and scripts/post-update-cmd were no longer running.

This was due to PHP exiting outright rather than returning the $exitCode.

After the 0.6.0 update, Composer's `scripts/post-install-cmd` and `scripts/post-update-cmd` were no longer running.

This was due to PHP _exiting_ outright rather than _returning_ the `$exitCode`.
@Potherca Potherca self-assigned this Jan 28, 2020
@Potherca Potherca changed the title Bugfix: Composer broken in 0.6.0 update Bugfix: Composer scripts/commands broken in 0.6.0 update Jan 28, 2020
@Potherca
Copy link
Member

Potherca commented Jan 28, 2020

Hi! Thank you for taking the time to report this issue and suggest a fix.

I will look into this today and (hopefully) merge and deploy a fix for this tomorrow.

For now, I'd like to make a reproduction scenario and an automated test to validate the correct behaviour.

Any updates will be posted here.

@BrianHenryIE
Copy link
Contributor Author

Create a new directory with composer.json:

{
  "require-dev": {
    "dealerdirect/phpcodesniffer-composer-installer": "0.5"
  },
  "scripts": {
    "post-install-cmd": [
      "echo \"Success\""
    ],
    "post-update-cmd": [
      "echo \"Success\""
    ]
  }
}

Execute composer install and observe "Success".

Change the version number to 0.6. Run composer update twice. All subsequent invocations of composer install or composer update will fail to print "Success". Return to version 0.5. Run composer update twice. All subsequent invocations will succeed.

@Potherca
Copy link
Member

Potherca commented Jan 29, 2020

Thank you for the detailed description! 👍
My test scenarios for this issue had a similar setup, but the details helped speed things up a bit.

The change fixes all the scenarios I created for this issue.
Since they do not break any of the already existing test scenarios, I am merging this.

Thanks again for your help!

@Potherca Potherca merged commit 8001af8 into PHPCSStandards:master Jan 29, 2020
@Potherca
Copy link
Member

The fix for this issue has been release as part of v0.6.2.
Feel free to update your project(s) as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants