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 Ensure that either HOME or COMPOSER_HOME is defined for Composer #35

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Extensions/ComposerLoaderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ protected function getInstalledConstraint(BaseRepository $repository, $packageNa
*/
public function onAfterBuild()
{
// Mock COMPOSER_HOME if it's not defined already. Composer requires one of the two to be set.
if (!getenv('HOME') && !getenv('COMPOSER_HOME')) {
putenv('COMPOSER_HOME=/tmp');
}

$originalDir = getcwd();
chdir(BASE_PATH);
/** @var Composer $composer */
Expand Down