Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
composer-upgrade: distinguishes correctly require and require-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 24, 2019
1 parent 96878bd commit 107b09f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/composer-upgrade.php
Expand Up @@ -17,12 +17,14 @@
}


$composer = json_decode(file_get_contents('composer.json'));
$outdated = json_decode(implode($output));
$upgrade = [];
foreach ($outdated->installed as $package) {
foreach ($masks as $mask) {
if (fnmatch($mask, $package->name)) {
$upgrade[] = $package->name;
$mode = isset($composer->require->{$package->name}) ? '' : '--dev';
$upgrade[$mode][] = $package->name;
continue 2;
}
}
Expand All @@ -33,5 +35,6 @@
exit;
}


passthru('composer --no-update --no-scripts require ' . implode(' ', $upgrade));
foreach ($upgrade as $mode => $packages) {
passthru('composer --no-update --no-scripts require ' . $mode . ' ' . implode(' ', $packages));
}

0 comments on commit 107b09f

Please sign in to comment.