Skip to content

Commit

Permalink
remove bin files after eject defined at package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
tuchk4 committed Feb 15, 2017
1 parent 075e729 commit fe108be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,17 @@ prompt(
);
console.log();

// remove react-scripts and react-scripts binaries from app node_modules
Object.keys(ownPackage.bin).forEach(function(binKey) {
fs.removeSync(path.join(appPath, 'node_modules', '.bin', binKey));
});
fs.removeSync(ownPath);

if (fs.existsSync(paths.yarnLockFile)) {
console.log(cyan('Running yarn...'));
fs.removeSync(ownPath);
spawnSync('yarnpkg', [], {stdio: 'inherit'});
} else {
console.log(cyan('Running npm install...'));
fs.removeSync(ownPath);
spawnSync('npm', ['install'], {stdio: 'inherit'});
}
console.log(green('Ejected successfully!'));
Expand Down

0 comments on commit fe108be

Please sign in to comment.