+5
-2
auth/client.go
+5
-2
auth/client.go
···
30
30
return &http.Client{Jar: jar}, nil
31
31
}
32
32
33
-
// saveCookies serializes the cookies and saves them to the system keyring
34
-
func saveCookies(cookies []*http.Cookie, host string, handle string) error {
33
+
// SaveCookies serializes the cookies and saves them to the system keyring
34
+
func SaveCookies(cookies []*http.Cookie, host string, handle string) error {
35
+
if len(cookies) == 0 {
36
+
return nil
37
+
}
35
38
data, err := json.Marshal(cookies)
36
39
if err != nil {
37
40
return err
+1
-1
auth/login.go
+1
-1
auth/login.go
+2
pr/create.go
+2
pr/create.go
···
140
140
return err
141
141
}
142
142
defer resp.Body.Close()
143
+
auth.SaveCookies(resp.Cookies(), knit.DefaultHost, handle)
143
144
144
145
if resp.StatusCode != http.StatusOK {
145
146
return fmt.Errorf("unexpected status code: %d", resp.StatusCode)
···
147
148
148
149
stop()
149
150
wg.Wait()
151
+
fmt.Printf("\x1b[32m✔\x1b[m PR created!\r\n")
150
152
151
153
return nil
152
154
}