mirror of
https://github.com/strapi/strapi.git
synced 2025-10-20 04:24:23 +00:00
Fix use ShellJS
This commit is contained in:
parent
6b1deaf0ed
commit
e60876fe0d
@ -13,6 +13,7 @@ const execSync = require('child_process').execSync;
|
|||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const inquirer = require('inquirer');
|
const inquirer = require('inquirer');
|
||||||
|
const shell = require('shelljs');
|
||||||
|
|
||||||
// Logger.
|
// Logger.
|
||||||
const logger = require('strapi-utils').logger;
|
const logger = require('strapi-utils').logger;
|
||||||
@ -207,14 +208,8 @@ module.exports = (scope, cb) => {
|
|||||||
try {
|
try {
|
||||||
require(path.resolve(`${scope.rootPath}/node_modules/${scope.client.connector}/lib/utils/connectivity.js`))(scope, cb.success, connectionValidation);
|
require(path.resolve(`${scope.rootPath}/node_modules/${scope.client.connector}/lib/utils/connectivity.js`))(scope, cb.success, connectionValidation);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
if(/^win/.test(process.platform)){
|
shell.rm('-r', scope.rootPath);
|
||||||
execSync(`rmdir ${scope.rootPath} /s /q`);
|
|
||||||
} else {
|
|
||||||
execSync(`rm -r ${scope.rootPath}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info('Copying the dashboard...');
|
logger.info('Copying the dashboard...');
|
||||||
|
|
||||||
cb.success();
|
cb.success();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user