-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
oanatmaria
committed
Oct 3, 2023
1 parent
c95260b
commit d436561
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package cmd | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/aserto-dev/topaz/pkg/cli/cc" | ||
"github.com/cli/browser" | ||
) | ||
|
||
type ConsoleCmd struct { | ||
ConsoleAdress string `arg:"" default:"https://localhost:8080/ui/directory" help:"gateway address of the console service"` | ||
} | ||
|
||
func (cmd *ConsoleCmd) Run(c *cc.CommonCtx) error { | ||
if !strings.HasSuffix(cmd.ConsoleAdress, "/ui/directory") { | ||
cmd.ConsoleAdress = cmd.ConsoleAdress + "/ui/directory" | ||
} | ||
if !strings.HasPrefix(cmd.ConsoleAdress, "https://") { | ||
cmd.ConsoleAdress = "https://" + cmd.ConsoleAdress | ||
} | ||
return browser.OpenURL(cmd.ConsoleAdress) | ||
} |