File tree 1 file changed +18
-0
lines changed
packages/react-scripts/scripts
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,24 @@ module.exports = function(
135
135
return ;
136
136
}
137
137
138
+ // modifies README.md commands based on user used package manager.
139
+ if ( useYarn ) {
140
+ try {
141
+ const readme = fs . readFileSync ( path . join ( appPath , 'README.md' ) , 'utf8' ) ;
142
+ fs . writeFileSync (
143
+ path . join ( appPath , 'README.md' ) ,
144
+ readme
145
+ . replace ( / n p m s t a r t / g, 'yarn start' )
146
+ . replace ( / n p m t e s t / g, 'yarn test' )
147
+ . replace ( / n p m r u n b u i l d / g, 'yarn build' )
148
+ . replace ( / n p m r u n e j e c t / g, 'yarn eject' ) ,
149
+ 'utf8'
150
+ ) ;
151
+ } catch ( err ) {
152
+ // Silencing the error. As it fall backs to using default npm commands.
153
+ }
154
+ }
155
+
138
156
// Rename gitignore after the fact to prevent npm from renaming it to .npmignore
139
157
// See: https://github.com/npm/npm/issues/1862
140
158
try {
You can’t perform that action at this time.
0 commit comments