@@ -31,11 +31,11 @@ const npmGlobalRoot = () => {
31
31
const cp = require ( "child_process" ) ;
32
32
return new Promise ( ( resolve , reject ) => {
33
33
const command = cp . spawn ( "npm" , [ "root" , "-g" ] ) ;
34
- command . on ( ' error' , ( error ) => reject ( error ) ) ;
35
- command . stdout . on ( ' data' , ( data ) => resolve ( data . toString ( ) ) ) ;
36
- command . stderr . on ( ' data' , ( data ) => reject ( data ) ) ;
37
- } )
38
- }
34
+ command . on ( " error" , ( error ) => reject ( error ) ) ;
35
+ command . stdout . on ( " data" , ( data ) => resolve ( data . toString ( ) ) ) ;
36
+ command . stderr . on ( " data" , ( data ) => reject ( data ) ) ;
37
+ } ) ;
38
+ } ;
39
39
40
40
module . exports = function promptForInstallation ( packages , ...args ) {
41
41
const nameOfPackage = "@webpack-cli/" + packages ;
@@ -69,7 +69,7 @@ module.exports = function promptForInstallation(packages, ...args) {
69
69
options [ 0 ] = "add" ;
70
70
}
71
71
72
- if ( packages == ' init' ) {
72
+ if ( packages === " init" ) {
73
73
if ( isYarn ) {
74
74
options . splice ( 1 , 1 ) ; // remove '-D'
75
75
options . splice ( 0 , 0 , "global" ) ;
@@ -96,10 +96,10 @@ module.exports = function promptForInstallation(packages, ...args) {
96
96
97
97
runCommand ( packageManager , options )
98
98
. then ( _ => {
99
- if ( packages == "init" ) {
99
+ if ( packages === "init" ) {
100
100
npmGlobalRoot ( )
101
101
. then ( ( root ) => {
102
- pathtoInit = path . resolve ( root . trim ( ) , "@webpack-cli" , "init" ) ;
102
+ const pathtoInit = path . resolve ( root . trim ( ) , "@webpack-cli" , "init" ) ;
103
103
return pathtoInit ;
104
104
} )
105
105
. then ( ( pathForInit ) => {
@@ -108,7 +108,7 @@ module.exports = function promptForInstallation(packages, ...args) {
108
108
. catch ( ( error ) => {
109
109
console . error ( error ) ;
110
110
process . exitCode = 1 ;
111
- } )
111
+ } ) ;
112
112
return ;
113
113
}
114
114
0 commit comments