[appveyor] fix
This commit is contained in:
parent
90494c20cc
commit
992a174470
|
@ -56,7 +56,7 @@ install:
|
|||
- php composer.phar self-update
|
||||
- copy /Y .composer\* %APPDATA%\Composer\
|
||||
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
|
||||
- php .github/build-packages.php %APPVEYOR_REPO_COMMIT%^^ src\Symfony\Bridge\PhpUnit
|
||||
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit
|
||||
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
|
||||
- php composer.phar config platform.php 5.3.9
|
||||
- php composer.phar update --no-progress --no-suggest --ansi
|
||||
|
|
|
@ -6,15 +6,20 @@ if (3 > $_SERVER['argc']) {
|
|||
}
|
||||
chdir(dirname(__DIR__));
|
||||
|
||||
$json = ltrim(file_get_contents('composer.json'));
|
||||
if ($json !== $package = preg_replace('/\n "repositories": \[\n.*?\n \],/s', '', $json)) {
|
||||
file_put_contents('composer.json', $package);
|
||||
}
|
||||
|
||||
$dirs = $_SERVER['argv'];
|
||||
array_shift($dirs);
|
||||
$mergeBase = trim(shell_exec(sprintf('git merge-base %s HEAD', array_shift($dirs))));
|
||||
$mergeBase = trim(shell_exec(sprintf('git merge-base "%s" HEAD', array_shift($dirs))));
|
||||
|
||||
$packages = array();
|
||||
$flags = \PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
|
||||
|
||||
foreach ($dirs as $k => $dir) {
|
||||
if (!system("git diff --name-only \"$mergeBase\" -- $dir", $exitStatus)) {
|
||||
if (!system("git diff --name-only $mergeBase -- $dir", $exitStatus)) {
|
||||
if ($exitStatus) {
|
||||
exit($exitStatus);
|
||||
}
|
||||
|
@ -74,7 +79,6 @@ if ($dirs) {
|
|||
'type' => 'composer',
|
||||
'url' => 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)).'/',
|
||||
));
|
||||
$json = preg_replace('/\n "repositories": \[\n.*?\n \],/s', '', $json);
|
||||
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
|
||||
file_put_contents('composer.json', $json);
|
||||
}
|
||||
|
|
Reference in New Issue