Commit d6a83aa8 authored by Valerii Sorokobatko's avatar Valerii Sorokobatko Committed by Dan Abramov
Browse files

Remove .bin files defined at react-scripts/package.json after eject (#1567)

* remove bin files after eject defined at package.json

* add swallowing try/catch
parent 1c0851de
4 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file,!1933Add note about installing watchman
Showing with 8 additions and 2 deletions
+8 -2
...@@ -148,13 +148,19 @@ prompt( ...@@ -148,13 +148,19 @@ prompt(
); );
console.log(); console.log();
try {
// 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);
} catch(e) {}
if (fs.existsSync(paths.yarnLockFile)) { if (fs.existsSync(paths.yarnLockFile)) {
console.log(cyan('Running yarn...')); console.log(cyan('Running yarn...'));
fs.removeSync(ownPath);
spawnSync('yarnpkg', [], {stdio: 'inherit'}); spawnSync('yarnpkg', [], {stdio: 'inherit'});
} else { } else {
console.log(cyan('Running npm install...')); console.log(cyan('Running npm install...'));
fs.removeSync(ownPath);
spawnSync('npm', ['install'], {stdio: 'inherit'}); spawnSync('npm', ['install'], {stdio: 'inherit'});
} }
console.log(green('Ejected successfully!')); console.log(green('Ejected successfully!'));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment