Merge pull request #469 from Nsbx/master

Fix package 'strapi-generate-new' on Windows
This commit is contained in:
Jim LAURIE 2018-01-19 16:55:58 +01:00 committed by GitHub
commit b04a2250a2
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,10 +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) {
execSync(`rm -r ${scope.rootPath}`);
shell.rm('-r', scope.rootPath);
logger.info('Copying the dashboard...');
cb.success();
}
});