@@ -66,7 +66,7 @@ func configSSH(filepath *string, remove *bool) func(c *cli.Context) error {
66
66
// SSH configs are not always already there.
67
67
currentConfig = ""
68
68
} else if err != nil {
69
- return xerrors .Errorf ("failed to read ssh config file %q: %w" , filepath , err )
69
+ return xerrors .Errorf ("read ssh config file %q: %w" , filepath , err )
70
70
}
71
71
72
72
startIndex := strings .Index (currentConfig , startToken )
@@ -80,7 +80,7 @@ func configSSH(filepath *string, remove *bool) func(c *cli.Context) error {
80
80
81
81
err = writeStr (* filepath , currentConfig )
82
82
if err != nil {
83
- return xerrors .Errorf ("failed to write to ssh config file %q: %v" , * filepath , err )
83
+ return xerrors .Errorf ("write to ssh config file %q: %v" , * filepath , err )
84
84
}
85
85
86
86
return nil
@@ -95,7 +95,7 @@ func configSSH(filepath *string, remove *bool) func(c *cli.Context) error {
95
95
96
96
me , err := entClient .Me ()
97
97
if err != nil {
98
- return xerrors .Errorf ("failed to fetch username: %w" , err )
98
+ return xerrors .Errorf ("fetch username: %w" , err )
99
99
}
100
100
101
101
envs , err := getEnvs (entClient )
@@ -107,7 +107,7 @@ func configSSH(filepath *string, remove *bool) func(c *cli.Context) error {
107
107
}
108
108
newConfig , err := makeNewConfigs (me .Username , envs , startToken , startMessage , endToken )
109
109
if err != nil {
110
- return xerrors .Errorf ("failed to make new ssh configurations: %w" , err )
110
+ return xerrors .Errorf ("make new ssh configurations: %w" , err )
111
111
}
112
112
113
113
// if we find the old config, remove those chars from the string
@@ -117,11 +117,11 @@ func configSSH(filepath *string, remove *bool) func(c *cli.Context) error {
117
117
118
118
err = writeStr (* filepath , currentConfig + newConfig )
119
119
if err != nil {
120
- return xerrors .Errorf ("failed to write new configurations to ssh config file %q: %w" , filepath , err )
120
+ return xerrors .Errorf ("write new configurations to ssh config file %q: %w" , filepath , err )
121
121
}
122
122
err = writeSSHKey (ctx , entClient )
123
123
if err != nil {
124
- return xerrors .Errorf ("failed to fetch and write ssh key: %w" , err )
124
+ return xerrors .Errorf ("fetch and write ssh key: %w" , err )
125
125
}
126
126
127
127
fmt .Printf ("An auto-generated ssh config was written to %q\n " , * filepath )
0 commit comments