Commit 9a988516 authored by Dan Abramov's avatar Dan Abramov Committed by Christopher Chedeau
Browse files

Use rimraf as it handles edge cases

parent f9fe9ff9
No related merge requests found
Showing with 5 additions and 3 deletions
+5 -3
......@@ -42,6 +42,7 @@
"html-webpack-plugin": "^2.22.0",
"json-loader": "^0.5.4",
"postcss-loader": "^0.9.1",
"rimraf": "^2.5.3",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^1.13.1",
......
......@@ -10,14 +10,14 @@
process.env.NODE_ENV = 'production';
var path = require('path');
var spawnSync = require('child_process').spawnSync;
var rimrafSync = require('rimraf').sync;
var webpack = require('webpack');
var config = require('../webpack.config.prod');
var isInNodeModules = 'node_modules' ===
path.basename(path.resolve(path.join(__dirname, '..', '..')));
var relative = isInNodeModules ? '../..' : '.';
spawnSync('rm', ['-rf', relative + '/build']);
rimrafSync(relative + '/build');
webpack(config).run(function(err, stats) {
if (err) {
......
......@@ -9,6 +9,7 @@
var fs = require('fs');
var path = require('path');
var rimrafSync = require('rimraf').sync;
var spawnSync = require('child_process').spawnSync;
console.log('Graduating...');
......@@ -74,7 +75,7 @@ fs.writeFileSync(
console.log();
console.log('Running npm install...');
spawnSync('rm', ['-rf', selfPath]);
rimrafSync(selfPath);
spawnSync('npm', ['install'], {stdio: 'inherit'});
console.log();
......
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