Skip to content

Commit

Permalink
Merge branch '5.6' of https://github.com/nulpatrol/framework into nul…
Browse files Browse the repository at this point in the history
…patrol-5.6
  • Loading branch information
taylorotwell committed May 14, 2018
2 parents 08c01b4 + 1aa183c commit a6d2705
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Illuminate/Foundation/Console/Presets/Preset.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@ protected static function ensureComponentDirectoryExists()
*
* @return void
*/
protected static function updatePackages()
protected static function updatePackages($devDependency = true)
{
if (! file_exists(base_path('package.json'))) {
return;
}

$dependenciesBlock = $devDependency ? 'devDependencies' : 'dependencies';
$packages = json_decode(file_get_contents(base_path('package.json')), true);

$packages['devDependencies'] = static::updatePackageArray(
$packages['devDependencies']
$packages[$dependenciesBlock] = static::updatePackageArray(
array_key_exists($dependenciesBlock, $packages) ? $packages[$dependenciesBlock] : []
);

ksort($packages['devDependencies']);
ksort($packages[$dependenciesBlock]);

file_put_contents(
base_path('package.json'),
Expand Down

0 comments on commit a6d2705

Please sign in to comment.