@@ -43,44 +43,17 @@ func NewClient(authConfig appleauth.AppleID, teamID string, cmdFactory ruby.Comm
4343 return nil , err
4444 }
4545
46- c := & Client {
46+ return & Client {
4747 workDir : dir ,
4848 authConfig : authConfig ,
4949 teamID : teamID ,
5050 cmdFactory : cmdFactory ,
51- }
52-
53- currentTeamID , err := c .login ()
54- if err != nil {
55- return nil , fmt .Errorf ("spaceship command failed: %s" , err )
56- }
57-
58- log .Debugf ("current team id: %s" , currentTeamID )
59-
60- c .teamID = currentTeamID
61-
62- return c , nil
63- }
64-
65- func (c * Client ) login () (string , error ) {
66- output , err := c .runSpaceshipCommand ("login" )
67- if err != nil {
68- return "" , fmt .Errorf ("running command failed with error: %s" , err )
69- }
70-
71- // {"data":"72SA8V3WYL"}
72- var teamIDResponse struct {
73- Data string `json:"data"`
74- }
75- if err := json .Unmarshal ([]byte (output ), & teamIDResponse ); err != nil {
76- return "" , fmt .Errorf ("failed to unmarshal response: %v" , err )
77- }
78-
79- return teamIDResponse .Data , nil
51+ }, nil
8052}
8153
8254// DevPortalClient ...
8355type DevPortalClient struct {
56+ * AuthClient
8457 * CertificateSource
8558 * ProfileClient
8659 * DeviceClient
@@ -89,6 +62,7 @@ type DevPortalClient struct {
8962// NewSpaceshipDevportalClient ...
9063func NewSpaceshipDevportalClient (client * Client ) autocodesign.DevPortalClient {
9164 return DevPortalClient {
65+ AuthClient : NewAuthClient (client ),
9266 CertificateSource : NewSpaceshipCertificateSource (client ),
9367 DeviceClient : NewDeviceClient (client ),
9468 ProfileClient : NewSpaceshipProfileClient (client ),
0 commit comments