Skip to content

Commit

Permalink
Forked react-scripts should retain the binary name (#754)
Browse files Browse the repository at this point in the history
* Forked react-scripts should retain the binary name

* Forked react-scripts should retain the binary name -- fixed issue with regex

* Forked react-scripts should retain the binary name -- fixed style nit
  • Loading branch information
shubheksha authored and gaearon committed Sep 25, 2016
1 parent e0dfa30 commit 1b6f58c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ prompt(
delete appPackage.scripts['eject'];
Object.keys(appPackage.scripts).forEach(function (key) {
appPackage.scripts[key] = appPackage.scripts[key]
.replace(
new RegExp(ownPackageName + ' (\\w+)', 'g'),
'node scripts/$1.js'
);
.replace(/react-scripts (\w+)/g, 'node scripts/$1.js');
});

// Add Jest config
Expand Down
8 changes: 4 additions & 4 deletions packages/react-scripts/scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ module.exports = function(appPath, appName, verbose, originalDirectory) {

// Setup the script rules
appPackage.scripts = {
'start': ownPackageName + ' start',
'build': ownPackageName + ' build',
'test': ownPackageName + ' test --env=jsdom',
'eject': ownPackageName + ' eject'
'start': 'react-scripts start',
'build': 'react-scripts build',
'test': 'react-scripts test --env=jsdom',
'eject': 'react-scripts eject'
};

fs.writeFileSync(
Expand Down

0 comments on commit 1b6f58c

Please sign in to comment.