From e60876fe0dd217aa414f99fe70122f19d8afba95 Mon Sep 17 00:00:00 2001 From: Nicolas Bondoux Date: Fri, 19 Jan 2018 15:41:01 +0100 Subject: [PATCH] Fix use ShellJS --- packages/strapi-generate-new/lib/before.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/strapi-generate-new/lib/before.js b/packages/strapi-generate-new/lib/before.js index 8f53267dae..70042d4c40 100755 --- a/packages/strapi-generate-new/lib/before.js +++ b/packages/strapi-generate-new/lib/before.js @@ -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(); } });