Skip to content

Commit f52b4cc

Browse files
authored
fix: properly handle both --cluster and --hostname options (#537)
fixes #534
1 parent 7054aa5 commit f52b4cc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Utils/Helpers.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface CommandArgs {
2323

2424
export interface ClusterArgs {
2525
cluster?: string;
26+
hostname?: string;
2627
}
2728

2829
export interface ClusterUrls {
@@ -54,11 +55,13 @@ export class Helpers {
5455
let bus: string;
5556
let api: string;
5657

57-
if (args.cluster) {
58-
let host = args.cluster;
58+
const hostname = args.cluster ?? args.hostname;
59+
60+
if (hostname) {
61+
let host = hostname;
5962

6063
try {
61-
({ host } = new URL(args.cluster as string));
64+
({ host } = new URL(hostname));
6265
} catch {
6366
// noop
6467
}

0 commit comments

Comments
 (0)