@@ -24,18 +24,16 @@ type InitCommand struct {
2424 io ui.IO
2525 newUnauthenticatedClient newClientFunc
2626 newClientWithCredentials func (credentials.Provider ) (secrethub.ClientInterface , error )
27- newClientWithSetupCode func (string ) (secrethub.ClientInterface , error )
2827 credentialStore CredentialConfig
2928 progressPrinter progress.Printer
3029}
3130
3231// NewInitCommand creates a new InitCommand.
33- func NewInitCommand (io ui.IO , newUnauthenticatedClient newClientFunc , newClientWithCredentials func (credentials.Provider ) (secrethub.ClientInterface , error ), newClientWithSetupCode func ( string ) (secrethub. ClientInterface , error ), credentialStore CredentialConfig ) * InitCommand {
32+ func NewInitCommand (io ui.IO , newUnauthenticatedClient newClientFunc , newClientWithCredentials func (credentials.Provider ) (secrethub.ClientInterface , error ), credentialStore CredentialConfig ) * InitCommand {
3433 return & InitCommand {
3534 io : io ,
3635 newUnauthenticatedClient : newUnauthenticatedClient ,
3736 newClientWithCredentials : newClientWithCredentials ,
38- newClientWithSetupCode : newClientWithSetupCode ,
3937 credentialStore : credentialStore ,
4038 progressPrinter : progress .NewPrinter (io .Output (), 500 * time .Millisecond ),
4139 }
@@ -159,7 +157,7 @@ func (cmd *InitCommand) Run() error {
159157 fmt .Fprint (cmd .io .Output (), "Setting up your account..." )
160158 cmd .progressPrinter .Start ()
161159
162- client , err := cmd .newClientWithSetupCode ( setupCode )
160+ client , err := cmd .newClientWithCredentials ( credentials . NewSetupCode ( setupCode ) )
163161 if err != nil {
164162 cmd .progressPrinter .Stop ()
165163 return err
0 commit comments