UNPKG

balena-cli

Version:

The official balena Command Line Interface

47 lines (45 loc) 1.85 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@oclif/core"); const lazy_1 = require("../../utils/lazy"); class OsVersionsCmd extends core_1.Command { async run() { const { args: params, flags: options } = await this.parse(OsVersionsCmd); if (options['include-draft']) { const { warnify } = await Promise.resolve().then(() => require('../../utils/messages')); console.error(warnify((0, lazy_1.stripIndent) ` Using pre-release balenaOS versions is only supported for OS updates and not for OS image downloads. `)); } const { formatOsVersion, getOsVersions } = await Promise.resolve().then(() => require('../../utils/cloud')); const vs = await getOsVersions(params.type, !!options.esr, options['include-draft']); console.log(vs.map((v) => formatOsVersion(v)).join('\n')); } } OsVersionsCmd.description = (0, lazy_1.stripIndent) ` Show available balenaOS versions for the given device type. Show the available balenaOS versions for the given device type. Check available types with \`balena device-type list\`. balenaOS ESR versions can be listed with the '--esr' option. See also: https://www.balena.io/docs/reference/OS/extended-support-release/ `; OsVersionsCmd.examples = ['$ balena os versions raspberrypi3']; OsVersionsCmd.args = { type: core_1.Args.string({ description: 'device type', required: true, }), }; OsVersionsCmd.flags = { esr: core_1.Flags.boolean({ description: 'select balenaOS ESR versions', default: false, }), 'include-draft': core_1.Flags.boolean({ description: 'include pre-release balenaOS versions', default: false, }), }; exports.default = OsVersionsCmd; //# sourceMappingURL=versions.js.map