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

Fix incorrect lookup path for installed.json #113

Merged
merged 7 commits into from
Nov 15, 2019
Merged

Fix incorrect lookup path for installed.json #113

merged 7 commits into from
Nov 15, 2019

Conversation

arondeparon
Copy link

This fixes the issue that cause Laravel installations with a dependency on 1.4.x to break that are installed using composer install --no-scripts as described in #112

@arondeparon arondeparon mentioned this pull request Nov 15, 2019
@Ocramius
Copy link
Owner

Hey @arondeparon, please also backport the tests :S

My suggestion is to use git cherry-pick rather than copy-pasting the diff

@Ocramius Ocramius added the bug label Nov 15, 2019
@Ocramius Ocramius added this to the 1.4.2 milestone Nov 15, 2019
@arondeparon
Copy link
Author

Will do! I did not see the backport yet and wrote the exact same fix as you already did 😉

Ocramius and others added 4 commits November 15, 2019 16:12
…son`

Due to `getcwd()` returning an empty string in some environments, (or even
`"."`, a dot, sometimes), this fallback versions logic was too fragile.

Adding hardcoded paths that are supposed to be constant (relative to the
installation path of `FallbackVersions.php`) gives us more stability.
Otherwise, composer cannot determine the current branch-alias, and fails
early during installation.
@Ocramius
Copy link
Owner

@arondeparon about 03e5174, I think master should stay with the current branch-alias, but the test should allow for \d+ as a start of the version string, rather than 1: https://travis-ci.org/Ocramius/PackageVersions/jobs/612436287#L335

@arondeparon
Copy link
Author

@Ocramius yeah I was not entirely sure about how you would like to see it, but noticed that dev-master pointed to the most current branch and 2.x did not exist.

I'll change the test to be a bit more flexible 👌

@arondeparon
Copy link
Author

arondeparon commented Nov 15, 2019

Tests passing now 😃

@Ocramius Ocramius self-assigned this Nov 15, 2019
@Ocramius
Copy link
Owner

LGTM! 👍

@Ocramius Ocramius merged commit 44af6f3 into Ocramius:1.4.x Nov 15, 2019
@arondeparon arondeparon deleted the hotfix/fix-incorrect-composer-path branch November 15, 2019 16:17
@Ocramius Ocramius changed the title Hotfix/fix incorrect composer path Fix incorrect lookup path for installed.json Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants