Fix use ShellJS

This commit is contained in:
Nicolas Bondoux 2018-01-19 15:41:01 +01:00 committed by GitHub
parent 6b1deaf0ed
commit e60876fe0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ const execSync = require('child_process').execSync;
const _ = require('lodash');
const fs = require('fs-extra');
const inquirer = require('inquirer');
const shell = require('shelljs');
// Logger.
const logger = require('strapi-utils').logger;
@ -207,14 +208,8 @@ module.exports = (scope, cb) => {
try {
require(path.resolve(`${scope.rootPath}/node_modules/${scope.client.connector}/lib/utils/connectivity.js`))(scope, cb.success, connectionValidation);
} catch(err) {
if(/^win/.test(process.platform)){
execSync(`rmdir ${scope.rootPath} /s /q`);
} else {
execSync(`rm -r ${scope.rootPath}`);
}
shell.rm('-r', scope.rootPath);
logger.info('Copying the dashboard...');
cb.success();
}
});