Move some v13 features behind v14 switch.

Change-type: patch
Signed-off-by: Scott Lowe <scott@balena.io>
This commit is contained in:
Scott Lowe 2021-12-17 16:40:47 +01:00 committed by Paulo Castro
parent 1ed39d1d37
commit 176d731f9e
3 changed files with 6 additions and 38 deletions

View File

@ -333,30 +333,6 @@ Examples:
### Options
#### --fields FIELDS
only show provided fields (comma-separated)
#### -j, --json
output in json format
#### --filter FILTER
filter results by substring matching of a given field, eg: --filter field=foo
#### --no-header
hide table header from output
#### --no-truncate
do not truncate output to fit screen
#### --sort SORT
field to sort by (prepend '-' for descending order)
## fleet &#60;fleet&#62;
Display detailed information about a single fleet.
@ -386,14 +362,6 @@ fleet name, slug (preferred), or numeric ID (deprecated)
### Options
#### --fields FIELDS
only show provided fields (comma-separated)
#### -j, --json
output in json format
## fleet create &#60;name&#62;
Create a new balena fleet.

View File

@ -23,7 +23,7 @@ import * as cf from '../../utils/common-flags';
import * as ca from '../../utils/common-args';
import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
import { applicationIdInfo } from '../../utils/messages';
import { isV13 } from '../../utils/version';
import { isV14 } from '../../utils/version';
import type { DataOutputOptions } from '../../framework';
interface FlagsDef extends DataOutputOptions {
@ -53,7 +53,7 @@ export default class FleetCmd extends Command {
public static flags: flags.Input<FlagsDef> = {
help: cf.help,
...(isV13() ? cf.dataOutputFlags : {}),
...(isV14() ? cf.dataOutputFlags : {}),
};
public static authenticated = true;
@ -81,7 +81,7 @@ export default class FleetCmd extends Command {
application.device_type = application.is_for__device_type[0].slug;
application.commit = application.should_be_running__release[0]?.commit;
if (isV13()) {
if (isV14()) {
await this.outputData(
application,
['app_name', 'id', 'device_type', 'slug', 'commit'],

View File

@ -20,7 +20,7 @@ import { flags } from '@oclif/command';
import Command from '../command';
import * as cf from '../utils/common-flags';
import { getBalenaSdk, getVisuals, stripIndent } from '../utils/lazy';
import { isV13 } from '../utils/version';
import { isV14 } from '../utils/version';
import type { DataSetOutputOptions } from '../framework';
interface ExtendedApplication extends ApplicationWithDeviceType {
@ -49,7 +49,7 @@ export default class FleetsCmd extends Command {
public static usage = 'fleets';
public static flags: flags.Input<FlagsDef> = {
...(isV13() ? cf.dataSetOutputFlags : {}),
...(isV14() ? cf.dataSetOutputFlags : {}),
help: cf.help,
};
@ -78,7 +78,7 @@ export default class FleetsCmd extends Command {
application.device_type = application.is_for__device_type[0].slug;
});
if (isV13()) {
if (isV14()) {
await this.outputData(
applications,
[