Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace rimraf with fs-extra functions #1072

Merged
merged 1 commit into from
Nov 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions packages/react-scripts/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 3 additions & 4 deletions packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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!'));
Expand Down