refactor(ioscompanion): inline firstNonEmpty

This commit is contained in:
pj committed 2026-06-09 18:22:21 +05:30
1 parent 9082ad906c
commit e7ae05c4d8
1 file changed
+5 -10
+5 -10
View File
@@ -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