Commit 2da6edab authored by Brian Ng's avatar Brian Ng Committed by Dan Abramov
Browse files

Replace rimraf with fs-extra functions (#1072)

parent 058b2cc8
No related merge requests found
Showing with 4 additions and 7 deletions
+4 -7
......@@ -58,7 +58,6 @@
"promise": "7.1.1",
"react-dev-utils": "^0.3.0",
"recursive-readdir": "2.1.0",
"rimraf": "2.5.4",
"strip-ansi": "3.0.1",
"style-loader": "0.13.1",
"url-loader": "0.5.7",
......
......@@ -24,7 +24,6 @@ var path = require('path');
var pathExists = require('path-exists');
var filesize = require('filesize');
var gzipSize = require('gzip-size').sync;
var rimrafSync = require('rimraf').sync;
var webpack = require('webpack');
var config = require('../config/webpack.config.prod');
var paths = require('../config/paths');
......@@ -78,7 +77,7 @@ recursive(paths.appBuild, (err, fileNames) => {
// Remove all content but keep the directory so that
// if you're in it, you don't end up in Trash
rimrafSync(paths.appBuild + '/*');
fs.emptyDirSync(paths.appBuild);
// Start the webpack build
build(previousSizeMap);
......
......@@ -8,12 +8,11 @@
*/
var createJestConfig = require('../utils/createJestConfig');
var fs = require('fs');
var fs = require('fs-extra');
var path = require('path');
var pathExists = require('path-exists');
var paths = require('../config/paths');
var prompt = require('react-dev-utils/prompt');
var rimrafSync = require('rimraf').sync;
var spawnSync = require('cross-spawn').sync;
var chalk = require('chalk');
var green = chalk.green;
......@@ -147,11 +146,11 @@ prompt(
if (pathExists.sync(paths.yarnLockFile)) {
console.log(cyan('Running yarn...'));
rimrafSync(ownPath);
fs.removeSync(ownPath);
spawnSync('yarn', [], {stdio: 'inherit'});
} else {
console.log(cyan('Running npm install...'));
rimrafSync(ownPath);
fs.removeSync(ownPath);
spawnSync('npm', ['install'], {stdio: 'inherit'});
}
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