File tree 1 file changed +7
-5
lines changed
src/Illuminate/Foundation/Console/Presets
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -23,22 +23,24 @@ protected static function ensureComponentDirectoryExists()
23
23
/**
24
24
* Update the "package.json" file.
25
25
*
26
+ * @param bool $dev
26
27
* @return void
27
28
*/
28
- protected static function updatePackages ($ devDependency = true )
29
+ protected static function updatePackages ($ dev = true )
29
30
{
30
31
if (! file_exists (base_path ('package.json ' ))) {
31
32
return ;
32
33
}
33
34
34
- $ dependenciesBlock = $ devDependency ? 'devDependencies ' : 'dependencies ' ;
35
+ $ configurationKey = $ dev ? 'devDependencies ' : 'dependencies ' ;
36
+
35
37
$ packages = json_decode (file_get_contents (base_path ('package.json ' )), true );
36
38
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 ] : []
39
41
);
40
42
41
- ksort ($ packages [$ dependenciesBlock ]);
43
+ ksort ($ packages [$ configurationKey ]);
42
44
43
45
file_put_contents (
44
46
base_path ('package.json ' ),
You can’t perform that action at this time.
0 commit comments