From b260f80bcce49bc39c69117d9f61728313541683 Mon Sep 17 00:00:00 2001 From: Matthew Yarmolinsky Date: Fri, 15 Jul 2022 13:54:29 +0000 Subject: [PATCH] Drop support for the deprecated `balena device public-url ` and related format Resolves: #2501 Change-type: major Signed-off-by: Matthew Yarmolinsky --- docs/balena-cli.md | 7 ------- lib/commands/device/public-url.ts | 30 ------------------------------ 2 files changed, 37 deletions(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 487b4e12..1e75d9ff 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -946,9 +946,6 @@ This command will output the current public URL for the specified device. It can also enable or disable the URL, or output the enabled status, using the respective options. -The old command style 'balena device public-url enable ' -is deprecated, but still supported. - Examples: $ balena device public-url 23c73a1 @@ -962,10 +959,6 @@ Examples: the uuid of the device to manage -#### LEGACYUUID - - - ### Options #### --enable diff --git a/lib/commands/device/public-url.ts b/lib/commands/device/public-url.ts index 761b3b56..d3cebf8a 100644 --- a/lib/commands/device/public-url.ts +++ b/lib/commands/device/public-url.ts @@ -32,8 +32,6 @@ interface FlagsDef { interface ArgsDef { uuid: string; - // Optional hidden arg to support old command format - legacyUuid?: string; } export default class DevicePublicUrlCmd extends Command { @@ -43,9 +41,6 @@ export default class DevicePublicUrlCmd extends Command { This command will output the current public URL for the specified device. It can also enable or disable the URL, or output the enabled status, using the respective options. - - The old command style 'balena device public-url enable ' - is deprecated, but still supported. `; public static examples = [ @@ -62,12 +57,6 @@ export default class DevicePublicUrlCmd extends Command { parse: (dev) => tryAsInteger(dev), required: true, }, - { - // Optional hidden arg to support old command format - name: 'legacyUuid', - parse: (dev) => tryAsInteger(dev), - hidden: true, - }, ]; public static usage = 'device public-url '; @@ -95,25 +84,6 @@ export default class DevicePublicUrlCmd extends Command { DevicePublicUrlCmd, ); - // Legacy command format support. - // Previously this command used the following format - // (changed due to oclif technicalities): - // `balena device public-url enable|disable|status ` - if (params.legacyUuid) { - const action = params.uuid; - if (!['enable', 'disable', 'status'].includes(action)) { - throw new ExpectedError( - `Unexpected arguments: ${params.uuid} ${params.legacyUuid}`, - ); - } - - options.enable = action === 'enable'; - options.disable = action === 'disable'; - options.status = action === 'status'; - params.uuid = params.legacyUuid; - delete params.legacyUuid; - } - const balena = getBalenaSdk(); if (options.enable) {