mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 14:37:47 +00:00
tunnel: Fix incorrect parsing of numeric short UUIDs
Change-type: patch Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
This commit is contained in:
parent
1d3af3245a
commit
f0030a1891
@ -25,6 +25,9 @@ import { tunnelConnectionToDevice } from '../utils/tunnel';
|
||||
|
||||
interface Args {
|
||||
deviceOrApplication: string;
|
||||
// when Capitano converts a positional parameter (but not an option)
|
||||
// to a number, the original value is preserved with the _raw suffix
|
||||
deviceOrApplication_raw: string;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
@ -88,6 +91,8 @@ export const tunnel: CommandDefinition<Args, Options> = {
|
||||
primary: true,
|
||||
|
||||
action: async (params, options) => {
|
||||
const deviceOrApplication =
|
||||
params.deviceOrApplication_raw || params.deviceOrApplication;
|
||||
const Logger = await import('../utils/logger');
|
||||
const logger = new Logger();
|
||||
const balena = await import('balena-sdk');
|
||||
@ -120,7 +125,7 @@ export const tunnel: CommandDefinition<Args, Options> = {
|
||||
? (options.port as string[])
|
||||
: [options.port as string];
|
||||
|
||||
const uuid = await getOnlineTargetUuid(sdk, params.deviceOrApplication);
|
||||
const uuid = await getOnlineTargetUuid(sdk, deviceOrApplication);
|
||||
const device = await sdk.models.device.get(uuid);
|
||||
|
||||
logger.logInfo(`Opening a tunnel to ${device.uuid}...`);
|
||||
|
Loading…
Reference in New Issue
Block a user