Skip to content

Commit

Permalink
Merge pull request #53 from 99designs/login-opens-url
Browse files Browse the repository at this point in the history
Use open-golang to open login url in default browser
  • Loading branch information
lox committed Nov 12, 2015
2 parents 8f1f5cf + 3fa23ec commit 13ff58e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion login.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"

"github.com/99designs/aws-vault/keyring"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/skratchdot/open-golang/open"
)

type LoginCommandInput struct {
Expand Down Expand Up @@ -84,5 +86,8 @@ func LoginCommand(ui Ui, input LoginCommandInput) {
url.QueryEscape(signinToken),
)

fmt.Println(loginUrl)
if err = open.Run(loginUrl); err != nil {
log.Println(err)
fmt.Println(loginUrl)
}
}

0 comments on commit 13ff58e

Please sign in to comment.