Skip to content
This repository was archived by the owner on Jul 18, 2019. It is now read-only.

Commit b6f5c63

Browse files
authored
Merge pull request #162 from taskcluster/fix-signin-on-windows
Fix signin on windows
2 parents 1ef2274 + 5791220 commit b6f5c63

3 files changed

Lines changed: 15 additions & 12 deletions

File tree

cmds/signin/signin.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strings"
1010
"time"
1111

12-
"github.com/bryanl/webbrowser"
12+
"github.com/pkg/browser"
1313
"github.com/spf13/cobra"
1414
"github.com/taskcluster/taskcluster-cli/cmds/root"
1515
"github.com/taskcluster/taskcluster-cli/config"
@@ -37,7 +37,7 @@ and save the temporary credentials to local configuration file.`,
3737
"loginUrl": config.OptionDefinition{
3838
Description: "URL for the login service.",
3939
Default: "https://login.taskcluster.net",
40-
Validate: func(value interface{}) error {
40+
Validate: func(value interface{}) error {
4141
if _, ok := value.(string); !ok {
4242
return errors.New("Must be a string")
4343
}
@@ -120,7 +120,8 @@ func cmdSignin(cmd *cobra.Command, _ []string) error {
120120

121121
// Open browser
122122
fmt.Fprintln(cmd.OutOrStdout(), "Listening for a callback on: "+target)
123-
webbrowser.Open(loginURL, webbrowser.NewWindow, true)
123+
fmt.Fprintln(cmd.OutOrStdout(), "Opening URL: "+loginURL)
124+
browser.OpenURL(loginURL)
124125

125126
// Start serving
126127
s.Serve(listener)

config/serialization.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ func Save(config map[string]map[string]interface{}) error {
170170

171171
// Write config file
172172
configFile := configFile()
173+
// Attempt to create config folder if it doesn't exist... (ignore errors)
174+
_ = os.MkdirAll(filepath.Dir(configFile), 0664)
173175
if err = ioutil.WriteFile(configFile, data, 0664); err != nil {
174176
return fmt.Errorf("Failed to write config file: %s, error: %s", configFile, err)
175177
}

vendor/vendor.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
"revision": "9f32b5905fd6ce7384093f9d048437e79f7b4d85",
1515
"revisionTime": "2017-02-20T21:12:21Z"
1616
},
17-
{
18-
"checksumSHA1": "2aoW+grkDcIBnIRJ3jLPV+uTnlA=",
19-
"path": "github.com/bryanl/webbrowser",
20-
"revision": "aa68d5a888ea07db1c2d2bed34f22e89cb3e3067",
21-
"revisionTime": "2016-11-16T10:45:37Z"
22-
},
2317
{
2418
"checksumSHA1": "gd4EYfpvepe0Svl+UVRP36iEd4Q=",
2519
"path": "github.com/burke/ttyutils",
@@ -124,6 +118,12 @@
124118
"revision": "98c11a7a6ec829d672b03833c3d69a7fae1ca972",
125119
"revisionTime": "2016-01-29T03:59:39Z"
126120
},
121+
{
122+
"checksumSHA1": "VQ8m0ncYJSbzslI7nVjiAdGEOeQ=",
123+
"path": "github.com/pkg/browser",
124+
"revision": "c90ca0c84f15f81c982e32665bffd8d7aac8f097",
125+
"revisionTime": "2017-05-05T12:59:00Z"
126+
},
127127
{
128128
"checksumSHA1": "LuFv4/jlrmFNnDb/5SCSEPAM9vU=",
129129
"path": "github.com/pmezard/go-difflib/difflib",
@@ -149,7 +149,7 @@
149149
"revisionTime": "2017-03-30T08:48:43Z"
150150
},
151151
{
152-
"checksumSHA1": "DCjamhJdcLN963jm6/yFoDbJvT4=",
152+
"checksumSHA1": "GPl+4G/6LSTGEgPtxqlIQhXJ82U=",
153153
"path": "github.com/shirou/gopsutil/disk",
154154
"revision": "e49a95f3d5f824c3f9875ca49e54e4fef17f82cf",
155155
"revisionTime": "2017-04-06T13:17:56Z"
@@ -161,7 +161,7 @@
161161
"revisionTime": "2017-04-06T13:17:56Z"
162162
},
163163
{
164-
"checksumSHA1": "zkNNauN735M7Jghr+MsARbb+/xQ=",
164+
"checksumSHA1": "rLo31ffS0VeaRYKDTm+WSd8nUQ4=",
165165
"path": "github.com/shirou/gopsutil/mem",
166166
"revision": "e49a95f3d5f824c3f9875ca49e54e4fef17f82cf",
167167
"revisionTime": "2017-04-06T13:17:56Z"
@@ -383,7 +383,7 @@
383383
"revisionTime": "2016-12-29T22:47:41Z"
384384
},
385385
{
386-
"checksumSHA1": "aQcK6fcqVIdpOQ7Gw6qkFiDtnrE=",
386+
"checksumSHA1": "oBjdFvDUZpioGsB6URqe16hDQUg=",
387387
"origin": "github.com/fatih/color/vendor/golang.org/x/sys/unix",
388388
"path": "golang.org/x/sys/unix",
389389
"revision": "9131ab34cf20d2f6d83fdc67168a5430d1c7dc23",

0 commit comments

Comments
 (0)