File tree Expand file tree Collapse file tree
src/Illuminate/Foundation/Console/Presets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,22 +23,24 @@ protected static function ensureComponentDirectoryExists()
2323 /**
2424 * Update the "package.json" file.
2525 *
26+ * @param bool $dev
2627 * @return void
2728 */
28- protected static function updatePackages ($ devDependency = true )
29+ protected static function updatePackages ($ dev = true )
2930 {
3031 if (! file_exists (base_path ('package.json ' ))) {
3132 return ;
3233 }
3334
34- $ dependenciesBlock = $ devDependency ? 'devDependencies ' : 'dependencies ' ;
35+ $ configurationKey = $ dev ? 'devDependencies ' : 'dependencies ' ;
36+
3537 $ packages = json_decode (file_get_contents (base_path ('package.json ' )), true );
3638
37- $ packages [$ dependenciesBlock ] = static ::updatePackageArray (
38- array_key_exists ($ dependenciesBlock , $ packages ) ? $ packages [$ dependenciesBlock ] : []
39+ $ packages [$ configurationKey ] = static ::updatePackageArray (
40+ array_key_exists ($ configurationKey , $ packages ) ? $ packages [$ configurationKey ] : []
3941 );
4042
41- ksort ($ packages [$ dependenciesBlock ]);
43+ ksort ($ packages [$ configurationKey ]);
4244
4345 file_put_contents (
4446 base_path ('package.json ' ),
You can’t perform that action at this time.
0 commit comments