@@ -34,7 +34,7 @@ type sshOptions struct {
3434 scpArgs []string // scp arguments, for 'cs cp' (nil for 'cs ssh')
3535}
3636
37- func newSSHCmd (app * App , f * cmdutil. Factory ) * cobra.Command {
37+ func newSSHCmd (app * App ) * cobra.Command {
3838 var opts sshOptions
3939
4040 sshCmd := & cobra.Command {
@@ -70,7 +70,7 @@ func newSSHCmd(app *App, f *cmdutil.Factory) *cobra.Command {
7070 fmt .Fprintf (os .Stderr , "%v\n " , err )
7171 }
7272
73- sshCmd .AddCommand (newConfigCmd (app , f ))
73+ sshCmd .AddCommand (newConfigCmd (app ))
7474
7575 return sshCmd
7676}
@@ -174,7 +174,7 @@ func (a *App) SSH(ctx context.Context, sshArgs []string, opts sshOptions) (err e
174174 }
175175}
176176
177- func (a * App ) printOpenSSHConfig (ctx context.Context , opts configOptions , executable string ) error {
177+ func (a * App ) printOpenSSHConfig (ctx context.Context , opts configOptions ) error {
178178 ctx , cancel := context .WithCancel (ctx )
179179 defer cancel ()
180180
@@ -258,6 +258,7 @@ func (a *App) printOpenSSHConfig(ctx context.Context, opts configOptions, execut
258258 return fmt .Errorf ("error formatting template: %w" , err )
259259 }
260260
261+ ghExec := a .executable .Executable ()
261262 for result := range sshUsers {
262263 if result .err != nil {
263264 fmt .Fprintf (os .Stderr , "%v\n " , result .err )
@@ -287,7 +288,7 @@ func (a *App) printOpenSSHConfig(ctx context.Context, opts configOptions, execut
287288 Name : result .codespace .Name ,
288289 EscapedRef : strings .ReplaceAll (result .codespace .GitStatus .Ref , "/" , "-" ),
289290 SSHUser : result .user ,
290- GHExec : executable ,
291+ GHExec : ghExec ,
291292 }
292293 if err := t .Execute (a .io .Out , conf ); err != nil {
293294 return err
@@ -392,7 +393,7 @@ type configOptions struct {
392393 codespace string
393394}
394395
395- func newConfigCmd (app * App , f * cmdutil. Factory ) * cobra.Command {
396+ func newConfigCmd (app * App ) * cobra.Command {
396397 var opts configOptions
397398
398399 configCmd := & cobra.Command {
@@ -418,7 +419,7 @@ func newConfigCmd(app *App, f *cmdutil.Factory) *cobra.Command {
418419 $ echo 'include ~/.ssh/codespaces' >> ~/.ssh/config'
419420 ` ),
420421 RunE : func (cmd * cobra.Command , args []string ) error {
421- return app .printOpenSSHConfig (cmd .Context (), opts , f . Executable () )
422+ return app .printOpenSSHConfig (cmd .Context (), opts )
422423 },
423424 DisableFlagsInUseLine : true ,
424425 }
0 commit comments