From ed1946ec3622997f2ceb9e9d4a979a132875c002 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 5 Nov 2024 08:04:38 -0500 Subject: [PATCH] `balena device tunnel` Change-type: patch --- src/commands/device/tunnel.ts | 11 ++--------- src/errors.ts | 6 ------ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/commands/device/tunnel.ts b/src/commands/device/tunnel.ts index 38d877ea..63f59aa1 100644 --- a/src/commands/device/tunnel.ts +++ b/src/commands/device/tunnel.ts @@ -16,11 +16,7 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import { - NoPortsDefinedError, - InvalidPortMappingError, - ExpectedError, -} from '../../errors'; +import { InvalidPortMappingError, ExpectedError } from '../../errors'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { lowercaseIfSlug } from '../../utils/normalization'; @@ -85,6 +81,7 @@ export default class DeviceTunnelCmd extends Command { 'port mapping in the format [:[localIP:]localPort]', char: 'p', multiple: true, + required: true, }), }; @@ -117,10 +114,6 @@ export default class DeviceTunnelCmd extends Command { } }; - if (options.port === undefined) { - throw new NoPortsDefinedError(); - } - // Ascertain device uuid const { getOnlineTargetDeviceUuid } = await import('../../utils/patterns'); const uuid = await getOnlineTargetDeviceUuid(sdk, params.deviceOrFleet); diff --git a/src/errors.ts b/src/errors.ts index f099305f..871f6f96 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -39,12 +39,6 @@ export class InvalidPortMappingError extends ExpectedError { } } -export class NoPortsDefinedError extends ExpectedError { - constructor() { - super('No ports have been provided.'); - } -} - export class SIGINTError extends ExpectedError {} /**