diff --git a/internal/driver/ioscompanion/devicerunner.go b/internal/driver/ioscompanion/devicerunner.go index a26fc5b..84e21c0 100644 --- a/internal/driver/ioscompanion/devicerunner.go +++ b/internal/driver/ioscompanion/devicerunner.go @@ -45,8 +45,12 @@ type signingCredentials struct { // readSigningCredentials gathers the signing inputs from the environment and // reports every missing one at once. The .p8 key must exist on disk. func readSigningCredentials() (signingCredentials, error) { + team := os.Getenv(envTeam) + if team == "" { + team = os.Getenv(envTeamFallback) + } creds := signingCredentials{ - team: firstNonEmpty(os.Getenv(envTeam), os.Getenv(envTeamFallback)), + team: team, authKeyPath: os.Getenv(envAuthKeyPath), authKeyID: os.Getenv(envAuthKeyID), authIssuerID: os.Getenv(envAuthIssuer), @@ -87,15 +91,6 @@ func VerifyDeviceSigning() error { return err } -func firstNonEmpty(values ...string) string { - for _, value := range values { - if value != "" { - return value - } - } - return "" -} - // realSpawnDeviceRunner regenerates the runner project, builds it for the device // (skipping when the cached build matches the current sources), injects the // session port into the device xctestrun, and spawns the test session that hosts