UNPKG

@sentry/wizard

Version:

Sentry wizard helping you to configure your project

60 lines 2.85 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkInstalledCLI = void 0; // @ts-expect-error - clack is ESM and TS complains about that. It works though const prompts_1 = __importDefault(require("@clack/prompts")); const Sentry = __importStar(require("@sentry/node")); const telemetry_1 = require("../telemetry"); const bash = __importStar(require("../utils/bash")); const clack_1 = require("../utils/clack"); const debug_1 = require("../utils/debug"); async function checkInstalledCLI() { (0, debug_1.debug)(`Checking if sentry-cli is installed`); const hasCli = bash.hasSentryCLI(); Sentry.setTag('has-cli', hasCli); if (hasCli) { // If the CLI is installed, we don't need to ask the user to install it and can exit early. (0, debug_1.debug)(`sentry-cli is installed`); return; } (0, debug_1.debug)(`sentry-cli is not installed, asking user to install it`); const shouldInstallCLI = await (0, telemetry_1.traceStep)('Ask for SentryCLI', () => (0, clack_1.askToInstallSentryCLI)()); if (shouldInstallCLI) { (0, debug_1.debug)(`User agreed to install sentry-cli`); await bash.installSentryCLI(); Sentry.setTag('CLI-Installed', true); } else { (0, debug_1.debug)(`User declined to install sentry-cli`); prompts_1.default.log.warn("Without sentry-cli, you won't be able to upload debug symbols to Sentry. You can install it later by following the instructions at https://docs.sentry.io/cli/"); Sentry.setTag('CLI-Installed', false); } } exports.checkInstalledCLI = checkInstalledCLI; //# sourceMappingURL=check-installed-cli.js.map