From 425eb8c5b75c2f6a837e6ae3da444b36b7474fda Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 23 Oct 2015 18:38:57 +0200 Subject: [PATCH] [travis] Reduce composer.json merge conflicts on per-components tests --- .travis.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.php b/.travis.php index c27942913a..1334f14ad4 100644 --- a/.travis.php +++ b/.travis.php @@ -19,13 +19,15 @@ foreach ($dirs as $dir) { } echo "$dir\n"; - $package = json_decode(file_get_contents($dir.'/composer.json')); + $json = file_get_contents($dir.'/composer.json'); + $package = json_decode($json); $package->repositories = array(array( 'type' => 'composer', 'url' => 'file://'.__DIR__.'/', )); - file_put_contents($dir.'/composer.json', json_encode($package, $flags)); + $json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1); + file_put_contents($dir.'/composer.json', $json); passthru("cd $dir && tar -cf package.tar --exclude='package.tar' *"); $package->version = $branch.'.x-dev';