File tree Expand file tree Collapse file tree 3 files changed +45
-44
lines changed
Expand file tree Collapse file tree 3 files changed +45
-44
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,6 @@ func init() {
2929 Cmd .AddCommand (infoCmd )
3030 Cmd .AddCommand (startCmd )
3131 Cmd .AddCommand (deployCmd )
32- Cmd .AddCommand (editCmd )
32+ Cmd .AddCommand (configureCmd )
3333 Cmd .AddCommand (cloneCmd )
3434}
Original file line number Diff line number Diff line change 1+ package app
2+
3+ import (
4+ "fmt"
5+
6+ "github.com/major-technology/cli/singletons"
7+ "github.com/major-technology/cli/utils"
8+ "github.com/spf13/cobra"
9+ )
10+
11+ // configureCmd represents the configure command
12+ var configureCmd = & cobra.Command {
13+ Use : "configure" ,
14+ Short : "Open the app configurations in your browser" ,
15+ Long : `Open the app configurations in your default browser for the current application.` ,
16+ RunE : func (cmd * cobra.Command , args []string ) error {
17+ return runConfigure (cmd )
18+ },
19+ }
20+
21+ func runConfigure (cmd * cobra.Command ) error {
22+ // Get application ID
23+ applicationID , err := getApplicationID ()
24+ if err != nil {
25+ return err
26+ }
27+
28+ // Get config to access frontend URI
29+ cfg := singletons .GetConfig ()
30+
31+ // Construct the app settings URL
32+ configureURL := fmt .Sprintf ("%s/home?dialog=app-settings&appId=%s" , cfg .FrontendURI , applicationID )
33+
34+ // Open the URL in the browser
35+ if err := utils .OpenBrowser (configureURL ); err != nil {
36+ // If browser fails to open, still show the URL
37+ cmd .Printf ("Failed to open browser automatically. Please visit:\n %s\n " , configureURL )
38+ return nil
39+ }
40+
41+ cmd .Printf ("Opening app configurations in your browser:\n %s\n " , configureURL )
42+ return nil
43+ }
44+
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments