File tree 1 file changed +11
-8
lines changed
packages/react-scripts/scripts
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -120,14 +120,17 @@ prompt(
120
120
console . log ( cyan ( 'Updating the scripts' ) ) ;
121
121
delete appPackage . scripts [ 'eject' ] ;
122
122
Object . keys ( appPackage . scripts ) . forEach ( function ( key ) {
123
- appPackage . scripts [ key ] = appPackage . scripts [ key ]
124
- . replace ( / r e a c t - s c r i p t s ( \w + ) / g, 'node scripts/$1.js' ) ;
125
- console . log (
126
- ' Replacing ' +
127
- cyan ( '"react-scripts ' + key + '"' ) +
128
- ' with ' +
129
- cyan ( '"node scripts/' + key + '.js"' )
130
- ) ;
123
+ Object . keys ( ownPackage . bin ) . forEach ( function ( binKey ) {
124
+ var regex = new RegExp ( binKey + ' (\\w+)' , 'g' ) ;
125
+ appPackage . scripts [ key ] = appPackage . scripts [ key ]
126
+ . replace ( regex , 'node scripts/$1.js' ) ;
127
+ console . log (
128
+ ' Replacing ' +
129
+ cyan ( '"' + binKey + ' ' + key + '"' ) +
130
+ ' with ' +
131
+ cyan ( '"node scripts/' + key + '.js"' )
132
+ ) ;
133
+ } ) ;
131
134
} ) ;
132
135
133
136
console . log ( ) ;
You can’t perform that action at this time.
0 commit comments