UNPKG

@amplitude/ampli

Version:

Amplitude CLI

40 lines (39 loc) 1.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = require("@oclif/command"); const base_1 = require("../base"); const status_1 = require("../actions/status"); class Verify extends base_1.default { async run() { const { flags: verifyFlags } = this.parse(Verify); await this.mustBeInitialized(verifyFlags, true); await this.runRecommendedPull(verifyFlags); const { missedEventCount, exitCode } = await new status_1.default(Object.assign(Object.assign({}, verifyFlags), { sourceDirs: undefined, [status_1.IS_MERGED]: false, [status_1.IS_LATEST]: false, [status_1.IS_LATEST_IF_NOT_DEFAULT_BRANCH]: false, instanceNames: undefined }), {}, this.actionConfig(Verify.id), this.setBranchMappedToMain.bind(this)).run(); if (missedEventCount > 0 || exitCode != null) { await this.finally(undefined); process.exit(exitCode !== null && exitCode !== void 0 ? exitCode : 2); } } } exports.default = Verify; Verify.id = 'verify'; Verify.description = 'verify (lint) your source code for analytics'; Verify.hidden = true; Verify.flags = Object.assign({ update: command_1.flags.boolean({ char: 'u', description: 'update tracking plan with latest implementation status', }), branch: command_1.flags.string({ char: 'b', description: 'enforces source is on provided the branch', }), [status_1.SKIP_UPDATE_ON_DEFAULT_BRANCH]: command_1.flags.boolean({ dependsOn: ['update'], description: `prevents updating implementation status on default branch`, }), runtime: command_1.flags.string({ hidden: true, description: '(developer) override source runtime id', }) }, base_1.default.commonFlagsWithToken); Verify.args = []; Verify.usage = 'verify'; Verify.examples = [ '$ ampli verify', '$ ampli verify -u', '$ ampli verify -b main', `$ ampli verify -u --${status_1.SKIP_UPDATE_ON_DEFAULT_BRANCH}`, ];