UNPKG

@sentry/wizard

Version:

Sentry wizard helping you to configure your project

58 lines 2.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.startWizard = exports.getCurrentIntegration = void 0; const BottomBar_1 = require("./BottomBar"); const Logging_1 = require("./Logging"); function sanitizeAndValidateArgs(argv) { if (argv.quiet === undefined) { argv.quiet = true; (0, Logging_1.dim)('will activate quiet mode for you'); } if (argv['skip-connect']) { argv.skipConnect = argv['skip-connect']; delete argv['skip-connect']; } argv.promoCode = argv['promo-code']; if (argv['ignore-git-changes']) { argv.ignoreGitChanges = argv['ignore-git-changes']; delete argv['ignore-git-changes']; } if (argv['xcode-project-dir']) { argv.xcodeProjectDir = argv['xcode-project-dir']; delete argv['xcode-project-dir']; } } function getCurrentIntegration(answers) { return answers.integration; } exports.getCurrentIntegration = getCurrentIntegration; async function startWizard(argv, ...steps) { try { sanitizeAndValidateArgs(argv); if (argv.debug) { (0, Logging_1.debug)(argv); } if (argv.quiet) { (0, Logging_1.dim)("Quiet mode On, DAMA, don't ask me anything"); } return await steps .map((step) => new step(argv)) .reduce(async (answer, step) => { const prevAnswer = await answer; const answers = await step.emit(prevAnswer); return { ...prevAnswer, ...answers }; }, Promise.resolve({})); } catch (e) { BottomBar_1.BottomBar.hide(); (0, Logging_1.nl)(); (0, Logging_1.red)('Sentry Wizard failed with:'); (0, Logging_1.red)(argv.debug && e instanceof Error ? e.message : String(e)); (0, Logging_1.nl)(); (0, Logging_1.red)('Protip: Add --debug to see whats going on'); (0, Logging_1.red)('OR use --help to see your options'); process.exit(1); } } exports.startWizard = startWizard; //# sourceMappingURL=Wizard.js.map