feat: add lerd cpx - #1548
Open
geodro wants to merge 1 commit into
Open
Conversation
cpx is to Composer what npx is to npm, a way to run a command from any Composer package without adding it to the project. Routing it through lerd is what makes it run on the PHP version the site is registered on rather than whatever PHP the host happens to have, which is the same reason lerd wraps composer and artisan. Most of this already worked before the command existed. Requiring cpx globally makes lerd sync a shim onto PATH like it does for any composer global binary, and lerd already execs with HOME set to the host's home, so the packages cpx fetches cache under ~/.cpx and survive a container restart. What the command adds is the explicit form and an error worth reading: without it, a missing cpx fails inside the container with "could not open input file" rather than naming the one command that fixes it. The binary is resolved through the same COMPOSER_HOME and XDG lookup the global bin sync uses, so a non-default composer home is followed rather than guessed at. Closes #1543
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cpx is to Composer what npx is to npm, a way to run a command from any Composer package without adding it to the project. Routing it through lerd is what makes it run on the PHP version the site is registered on rather than whatever PHP the host happens to have, the same reason lerd wraps composer and artisan.
Worth saying plainly: most of this already worked before the command existed. Requiring cpx globally makes lerd sync a shim onto PATH like it does for any composer global binary, and lerd already execs with HOME set to the host's home, so the packages cpx fetches cache under ~/.cpx and survive a container restart. What the command adds is the explicit form and an error worth reading, since without it a missing cpx fails inside the container with "could not open input file" rather than naming the one command that fixes it.
The binary is resolved through the same COMPOSER_HOME and XDG lookup the global bin sync uses, so a non-default composer home is followed rather than guessed at.
Confirmed against a real project on 8.5, running a package the project does not have:
Note the package is cpx/cpx, not laravel/cpx as the repo name suggests.
Closes #1543