UNPKG

@amplitude/ampli

Version:

Amplitude CLI

26 lines (25 loc) 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = require("@oclif/command"); const base_1 = require("../base"); const pull_1 = require("../actions/pull"); const configure_1 = require("../actions/configure"); class Checkout extends base_1.default { async run() { const { flags: checkoutFlags, args: { branch } } = this.parse(Checkout); await this.mustBeInitialized(checkoutFlags, true); await new pull_1.default(Object.assign(Object.assign({}, checkoutFlags), { branch, path: undefined, omitApiKeys: undefined, [configure_1.DEPRECATED_RUNTIMES]: undefined }), { source: undefined }, this.actionConfig(Checkout.id), this.setBranchMappedToMain.bind(this)).run(true); } } exports.default = Checkout; Checkout.id = 'checkout'; Checkout.description = 'checkout a branch for the current source'; Checkout.flags = Object.assign({ version: command_1.flags.string({ char: 'v', description: 'the version to checkout' }) }, base_1.default.commonFlagsWithToken); Checkout.args = [ { name: 'branch', required: false }, ]; Checkout.usage = 'checkout [<branch>]'; Checkout.examples = [ '$ ampli checkout develop', '$ ampli checkout', ];