Skip to content

Commit

Permalink
fix: properly handle both --cluster and --hostname options (#537)
Browse files Browse the repository at this point in the history
fixes #534
  • Loading branch information
derevnjuk authored Apr 17, 2024
1 parent 7054aa5 commit f52b4cc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Utils/Helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface CommandArgs {

export interface ClusterArgs {
cluster?: string;
hostname?: string;
}

export interface ClusterUrls {
Expand Down Expand Up @@ -54,11 +55,13 @@ export class Helpers {
let bus: string;
let api: string;

if (args.cluster) {
let host = args.cluster;
const hostname = args.cluster ?? args.hostname;

if (hostname) {
let host = hostname;

try {
({ host } = new URL(args.cluster as string));
({ host } = new URL(hostname));
} catch {
// noop
}
Expand Down

0 comments on commit f52b4cc

Please sign in to comment.