Skip to content

Instantly share code, notes, and snippets.

@ostark
Created April 7, 2017 10:01
Show Gist options
  • Save ostark/d91fe238a9414529645c64c246e3c0f5 to your computer and use it in GitHub Desktop.
Save ostark/d91fe238a9414529645c64c246e3c0f5 to your computer and use it in GitHub Desktop.
composer global
pre: pre-deploy.php
sustained:
- vendor
- .composer-global
<?php
$appName = getenv('APP_NAME');
$installDir = "/srv/app/$appName/htdocs/.composer-global";
$package = "fxp/composer-asset-plugin";
if (!is_dir($installDir)) {
mkdir($installDir);
}
if (!is_dir("$installDir/vendor")) {
exec("composer global require -d $installDir $package");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment