Skip to content

Commit fd779a7

Browse files
Merge pull request #95 from pluralsh/mjg/eng-74-github-oauth-fails-when-trying-to-create
Don't reuse previous deploy keys
2 parents 494b2da + 2996066 commit fd779a7

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

pkg/scm/keys.go

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ type keys struct {
1919
}
2020

2121
func generateKeys() (pub string, priv string, err error) {
22-
pub, priv, found := readKeys()
23-
if found {
24-
return
25-
}
26-
2722
pubKey, privKey, err := ed25519.GenerateKey(rand.Reader)
2823
if err != nil {
2924
return
@@ -44,30 +39,6 @@ func generateKeys() (pub string, priv string, err error) {
4439
return
4540
}
4641

47-
func readKeys() (pub string, priv string, found bool) {
48-
keys, err := keyFiles()
49-
if err != nil {
50-
return
51-
}
52-
53-
if !utils.Exists(keys.pub) || !utils.Exists(keys.priv) {
54-
return
55-
}
56-
57-
pub, err = utils.ReadFile(keys.pub)
58-
if err != nil {
59-
return
60-
}
61-
62-
priv, err = utils.ReadFile(keys.priv)
63-
if err != nil {
64-
return
65-
}
66-
67-
found = true
68-
return
69-
}
70-
7142
func saveKeys(pub, priv string) error {
7243
if !utils.Confirm("Would you like to save the keys to ~/.ssh?") {
7344
return nil
@@ -90,12 +61,7 @@ func saveKeys(pub, priv string) error {
9061
return err
9162
}
9263

93-
if sshadd, _ := utils.Which("ssh-add"); sshadd && utils.Confirm("would you like to add this key to your ssh agent (ignore if your git ssh is set up)?") {
94-
return utils.Exec("ssh-add", keys.priv)
95-
}
96-
97-
utils.Highlight("It looks like ssh isn't configured locally, once you have it set up, you can run `ssh-add ~/.ssh/id_plural` to add the key to your agent")
98-
return err
64+
return nil
9965
}
10066

10167
func keyFiles() (keys keys, err error) {

0 commit comments

Comments
 (0)