UNPKG

projex

Version:
83 lines (82 loc) 3.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _api_1 = require("../../api/index"); const _modules_1 = require("../../modules/index"); const core_1 = require("@oclif/core"); const _shared_1 = require("../../shared/index"); class Release extends core_1.Command { static description = 'Bumps the app version, commits, and pushes the app to the remote repository (Only for git users).'; static examples = [ `${_api_1.Colors.PINK(`${_shared_1.CLI_NAME} git release`)}`, `${_api_1.Colors.PINK(`${_shared_1.CLI_NAME} git release`)} beta`, `${_api_1.Colors.PINK(`${_shared_1.CLI_NAME} git release`)} stable`, ]; static flags = { ..._shared_1.globalFlags, yes: core_1.Flags.boolean({ description: 'Automatically answer yes to all prompts.', char: 'y', default: false, }), 'no-push': core_1.Flags.boolean({ description: 'Do not automatically push all changes to the remote repository.', default: false, }), 'no-deploy': core_1.Flags.boolean({ description: 'Do not automatically run the preRelease script from the manifest file.', default: false, }), 'no-check-release': core_1.Flags.boolean({ description: 'Do not automatically check if the release is valid and does not have local changes.', default: false, }), 'no-pre-release': core_1.Flags.boolean({ description: 'Do not automatically run the preRelease script from the manifest file.', default: false, }), 'no-post-release': core_1.Flags.boolean({ description: 'Do not automatically run the postRelease script from the manifest file.', default: false, }), 'no-tag': core_1.Flags.boolean({ description: 'Do not automatically tag the release.', default: false, }), 'get-version': core_1.Flags.boolean({ description: 'Only get the current version without performing any release actions.', default: false, }), 'get-release-type': core_1.Flags.boolean({ description: 'Get the release type of the current version.', default: false, }), 'get-only-version-number': core_1.Flags.boolean({ description: 'Get the version number only.', default: false, }), }; static args = { tagName: core_1.Args.string({ required: false, default: '', options: Object.keys(_modules_1.supportedTagNames), description: 'The name of the tag. Defaults to "beta".', }), }; async run() { const { flags: { yes }, flags, args: { tagName }, } = await this.parse(Release); await (0, _modules_1.release)({ yes, noDeploy: flags['no-deploy'], noPush: flags['no-push'], noCheckRelease: flags['no-check-release'], noTag: flags['no-tag'], getVersion: flags['get-version'], noPreRelease: flags['no-pre-release'], noPostRelease: flags['no-post-release'], getReleaseType: flags['get-release-type'], getOnlyVersionNumber: flags['get-only-version-number'], }, tagName); } } exports.default = Release;