367.index.js 1.7 KB
"use strict";
exports.id = 367;
exports.ids = [367];
exports.modules = {

/***/ 18367:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
const process_command_args_1 = __webpack_require__(52369);
const legacyError = __webpack_require__(79407);
const drift_1 = __webpack_require__(26445);
const get_iac_org_settings_1 = __webpack_require__(1802);
const assert_iac_options_flag_1 = __webpack_require__(68590);
const config_1 = __webpack_require__(22541);
exports.default = async (...args) => {
    var _a, _b;
    const { options } = process_command_args_1.processCommandArgs(...args);
    // Ensure that this gen-driftignore command can only be runned when using `snyk iac gen-driftignore`
    // Avoid `snyk gen-driftignore` direct usage
    if (options.iac != true) {
        return legacyError('gen-driftignore');
    }
    // Ensure that we are allowed to run that command
    // by checking the entitlement
    const orgPublicId = (_a = options.org) !== null && _a !== void 0 ? _a : config_1.default.org;
    const iacOrgSettings = await get_iac_org_settings_1.getIacOrgSettings(orgPublicId);
    if (!((_b = iacOrgSettings.entitlements) === null || _b === void 0 ? void 0 : _b.iacDrift)) {
        throw new assert_iac_options_flag_1.UnsupportedEntitlementCommandError('gen-driftignore', 'iacDrift');
    }
    try {
        const args = drift_1.parseGenDriftIgnoreFlags(options);
        const ret = await drift_1.driftctl(args);
        process.exit(ret);
    }
    catch (e) {
        const err = new Error('Error running `iac gen-driftignore` ' + e);
        return Promise.reject(err);
    }
};


/***/ })

};
;
//# sourceMappingURL=367.index.js.map