mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
refactor(ioscompanion): inline firstNonEmpty
This commit is contained in:
1 parent
9082ad906c
commit
e7ae05c4d8
1 file changed
+5
-10
@@ -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
|
||||
|
||||
Reference in new issue
Block a user