@modyo/cli
Version:
Modyo CLI Command line to expose local development tools
27 lines (26 loc) • 993 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const fs_extra_1 = require("fs-extra");
const confirm_1 = tslib_1.__importDefault(require("@inquirer/confirm"));
const debug_1 = tslib_1.__importDefault(require("debug"));
const core_1 = require("@oclif/core");
const debug = (0, debug_1.default)('get/check-tp-overrides.ts');
async function checkToOverrides(path, force) {
if (force) {
debug('override force is true');
return true;
}
const FOLDER_EXIST = (0, fs_extra_1.existsSync)(path);
if (FOLDER_EXIST) {
debug('ask to override');
const override = await (0, confirm_1.default)({ message: `Do you want to override the folder ${path} (y/n)` });
if (!override) {
debug("can't override");
throw new core_1.Errors.CLIError("Can't Override Folder");
}
debug('will override');
}
return true;
}
exports.default = checkToOverrides;