Skip to content

Commit

Permalink
Merge pull request #193 from DopplerHQ/ruud_open_dashboard_config
Browse files Browse the repository at this point in the history
Open current project and config on 'doppler open'
  • Loading branch information
rgmvisser authored Mar 26, 2021
2 parents 6eac574 + 79b64c9 commit 2586d6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/cmd/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ limitations under the License.
package cmd

import (
"fmt"

"github.com/DopplerHQ/cli/pkg/configuration"
"github.com/DopplerHQ/cli/pkg/utils"
"github.com/skratchdot/open-golang/open"
Expand All @@ -41,7 +43,13 @@ var openDashboardCmd = &cobra.Command{
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
localConfig := configuration.LocalConfig(cmd)
err := open.Run(localConfig.DashboardHost.Value)
project := localConfig.EnclaveProject.Value
config := localConfig.EnclaveConfig.Value
url := localConfig.DashboardHost.Value
if project != "" && config != "" {
url = url + fmt.Sprintf("/workplace/projects/%s/configs/%s", project, config)
}
err := open.Run(url)
if err != nil {
utils.HandleError(err)
}
Expand Down

0 comments on commit 2586d6b

Please sign in to comment.